Avoid mounting environment variable file itself as a volume to allow config changes with container restarts #12

Open
opened 2023-05-05 15:16:02 +00:00 by SteveDinn · 0 comments

In the example docker-compose.yml file on https://quay.io/repository/zknt/pixelfed, the .env file is mounted as a volume directly.

    volumes:
      - "app-storage:/var/www/storage"
      - "./env:/var/www/.env"

When a file is mounted as a volume (rather than a directory), docker requires the container to be re-created each time the file is changed -- a restart command does not allow the container to see any changes to files directly mounted as volumes.

It would be cool if the .env file could be accessed via a folder volume rather than the file itself, so a simple restart would be possible. This can't be fixed by just changing the docker-compose.yml with the existing image because the www folder can't be overriden with a volume mount lest you lose what you're using the image for in the first place.

Thanks!

FYI: Thanks for creating this docker image. I wouldn't be self-hosting Pixelfed without it.

In the example `docker-compose.yml` file on [https://quay.io/repository/zknt/pixelfed](https://quay.io/repository/zknt/pixelfed), the `.env` file is mounted as a volume directly. ``` volumes: - "app-storage:/var/www/storage" - "./env:/var/www/.env" ``` When a file is mounted as a volume (rather than a directory), docker requires the container to be re-created each time the file is changed -- a `restart` command does not allow the container to see any changes to files directly mounted as volumes. It would be cool if the `.env` file could be accessed via a folder volume rather than the file itself, so a simple `restart` would be possible. This can't be fixed by just changing the `docker-compose.yml` with the existing image because the `www` folder can't be overriden with a volume mount lest you lose what you're using the image for in the first place. Thanks! FYI: Thanks for creating this docker image. I wouldn't be self-hosting Pixelfed without it.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: dockers/pixelfed#12
No description provided.