docker / awesome-compose

Awesome Docker Compose samples
https://docs.docker.com/compose/
Creative Commons Zero v1.0 Universal
34.57k stars 6.64k forks source link

Question : nginx-wsgi-flask -> compose.yaml #399

Closed Foundsheep closed 12 months ago

Foundsheep commented 12 months ago

Hi there,

In case someone wants to use a volume to gather logs from the services like me, could we change the script as follows and won't there be any problems, or could I just write another line in the volume section?

/nginx/Dockerfile

...
COPY --chown=nginx:nginx start.sh /app/start.sh
COPY --chown=nginx:nginx default.conf /tmp/default.conf  # line added
...

compose.yaml

services:
  nginx-proxy:
    ...
    volumes:
      - <my-volume-name>:<location-to-logs>  # replaced ./nginx/default.conf:/tmp/default.conf
...
volume:
  <my-volume-name>:
Foundsheep commented 12 months ago

I found the answer myself. Basically, I could have two lines in compose.yaml's volumes section