A docker-compose.yml file is a human-readable YAML configuration that records how Docker should build and run an application. It replaces repeated terminal commands with reusable instructions for services, images, ports, and mounted files. section 12.2.6
Listing 12.4 The docker-compose.yml file
services:
fact-frenzy-app:
build: .
ports:
- "8502:8501"
volumes:
- ./.streamlit/:/app/.streamlit
This configuration defines a fact-frenzy-app service, builds from the current directory, maps host port 8502 to container port 8501, and mounts local Streamlit settings into the container. section 12.2.6
Start the configured application
Run docker-compose up from the project directory. Docker Compose builds the image when necessary, starts the container, applies the port mapping and volume mount, and makes the Streamlit app available at http://localhost:8502. section 12.2.6
Adapt the configuration when moving from local Docker usage to Elastic Beanstalk:
- Replace the local .streamlit volume source with /var/app/secrets/.streamlit, where Elastic Beanstalk creates the secrets file. section 12.3.5
- Recognize that a local filesystem mount works with docker-compose up but cannot provide the same file directly in Elastic Beanstalk. section 12.3.5




