With all these elements, we can create the service to locally deploy the Thoughts service:
server:
env_file: environment.env
image: thoughts_server
build:
context: .
dockerfile: docker/app/Dockerfile
ports:
- "8000:8000"
depends_on:
- db
We need to be sure to add the dependency of the db database service. We also bound the internal port so that we can access it locally.
We start the service with the up command. There are some differences between the up and the run commands, but the main one is that run is for single commands that start and stop, while up is designed for services. For example, run creates an interactive Terminal, which displays colors, and up shows the standard output as logs, including the time when they were generated, accepts the...