docker / awesome-compose

Awesome Docker Compose samples

Home Page:https://docs.docker.com/compose/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Foundsheep opened this issue · comments

commented

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>:
commented

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