You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am deploying the docker postgres as part of a docker-compose, using a volume (data-volume) to export a .csv file, which is sent to elasticsearch via logstash. When I try to copy a query row to this file via:
const rows = await db.query(COPY (SELECT * FROM tokenoffchain WHERE id = (SELECT MAX(id) FROM tokenoffchain)) TO '${process.env.PATH_ELK_CSV}' WITH CSV DELIMITER ',' HEADER ESCAPE '\n' );
, I get a write permission error. So I create the "docker-entrypoint.sh" and pass it through volume as the figure shown.
Considering that I have set both POSTGRES_USER and POSTGRES_PASSWORD as environment variables, I am not clear why I cannot change the property or enable the permissions on the .csv file if the docker-entrypoint.sh is:
At this moment, I'm setting the permission manually.
Thanks in advance,
Santiago.
The text was updated successfully, but these errors were encountered:
The entrypoint initdb scripts don't ever run as root, so chown/chmod won't work there and if you need files with different ownership, you'll need to do that before the entrypoint runs (preferably on the host directly, but you could also do something like docker run ... sh -c 'chown ... && chmod ... && exec docker-entrypoint.sh ...'.
Thanks @tianon, since I need to use docker-compose y have tried passing "sh -c 'chown ... && chmod ..." via command, creating the volume (- data-volume:/var/local) before, but it fail until now. I will continue setting permissions manually, until I found a solution.
Hi,
I am deploying the docker postgres as part of a docker-compose, using a volume (data-volume) to export a .csv file, which is sent to elasticsearch via logstash. When I try to copy a query row to this file via:
const rows = await db.query(
COPY (SELECT * FROM tokenoffchain WHERE id = (SELECT MAX(id) FROM tokenoffchain)) TO '${process.env.PATH_ELK_CSV}' WITH CSV DELIMITER ',' HEADER ESCAPE '\n');
, I get a write permission error. So I create the "docker-entrypoint.sh" and pass it through volume as the figure shown.
Considering that I have set both POSTGRES_USER and POSTGRES_PASSWORD as environment variables, I am not clear why I cannot change the property or enable the permissions on the .csv file if the docker-entrypoint.sh is:
At this moment, I'm setting the permission manually.
Thanks in advance,
Santiago.
The text was updated successfully, but these errors were encountered: