Docker Compose is a configuration manager for Docker. Instead of repeatedly typing long commands, you describe an application's services, build instructions, ports, and volumes in a human-readable YAML file named docker-compose.yml. section 12.2.6
A Compose configuration can preserve the important parts of a Docker run setup:
- Define a service, such as fact-frenzy-app. section 12.2.6
- Build the image from the Dockerfile in the current directory with build: .. section 12.2.6
- Map host port 8502 to container port 8501 and mount the host .streamlit directory at /app/.streamlit. section 12.2.6
Listing 12.4 The docker-compose.yml file
services:
fact-frenzy-app:
build: .
ports:
- "8502:8501"
volumes:
- ./.streamlit/:/app/.streamlit
Use the Compose listing to inspect the complete service, port mapping, image build instruction, and configuration volume mount. section 12.2.6
Starting the application
Running docker-compose up builds the image when necessary, starts the container with the declared settings, and makes the Streamlit application available at http://localhost:8502 with its secrets configured. section 12.2.6














