May 2023
Intermediate to advanced
476 pages
12h 5m
English
Before proceeding, let’s take one last look at the web service defined in the docker-compose.yml:
| | web: |
| | build: . |
| | volumes: |
| | - ./log:/home/app/depot/log |
| | secrets: |
| | - source: master_key |
| | target: /home/app/depot/config/master.key |
| | ports: |
| | - "8001:80" |
| | depends_on: |
| | - db |
We’ve seen the volumes definition before; in this case it maps the log directory in the container to our local log directory. We previously covered how secrets are managed.
ports is new. This maps port 8001 on our development machine to port 80 in the container. This means that we’ll be able to access our application as http://localhost:8001 once it’s up and running.
depends_on controls the startup ...
Read now
Unlock full access