-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
platform: infrastructureDocker, hosting, CI/CD, etc.Docker, hosting, CI/CD, etc.platform: mobile.NET MAUI app.NET MAUI appstatus: todoTask is defined but not yet startedTask is defined but not yet started
Milestone
Description
Milestone: Milestone 5: Infrastructure & Tools
Category: 5.1 Docker
Task: Set up Docker Compose to orchestrate the backend API and database services.
Description
This task involves creating a docker-compose.yml file to easily manage the orchestration of the backend API and the database container(s). Docker Compose will define and run multi-container Docker applications, simplifying the management and deployment of the backend API and its dependencies (MySQL).
Subtasks:
- Create a
docker-compose.ymlfile at the root of the project - Define services for:
- Backend API (Python container using the
Dockerfilecreated in Dockerfile for backend API) - Database (PostgreSQL/MySQL or any other used database for the backend)
- Backend API (Python container using the
- Set up environment variables for both services (e.g., database credentials, API keys)
- Configure a network for communication between containers (e.g., a custom network like
app-network) - Define ports to expose for the backend API and database (e.g., backend on port
5000, database on default ports) - Add volume mounts for persistent data storage (e.g., for database data)
- Ensure the backend waits for the database service to be ready before starting (using
depends_onin Docker Compose) - Create a
.envfile for environment variables (e.g., database username/password, API keys) and use it with Docker Compose - Verify that both services can be brought up and down using Docker Compose commands (
docker-compose up,docker-compose down) - Test that the backend API correctly connects to the database in the Docker Compose environment
- Document how to use Docker Compose for local development and production in the README
Technical Considerations:
- Make sure to include the necessary database container (e.g.,
postgres:latest,mysql:latest) - Configure Docker Compose for multi-stage builds if required, ensuring production readiness
- Ensure proper volume setup for persistent data (database, application state)
- Verify network settings to ensure proper communication between containers
- Handle secrets like database passwords via
.envor Docker Secrets for production use
Acceptance Criteria:
- The
docker-compose.ymlfile is set up to run the backend API and database containers - The backend and database communicate correctly within the Docker Compose setup
- The
docker-compose upcommand successfully spins up the services - Documentation on how to use Docker Compose is added to the README file
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
platform: infrastructureDocker, hosting, CI/CD, etc.Docker, hosting, CI/CD, etc.platform: mobile.NET MAUI app.NET MAUI appstatus: todoTask is defined but not yet startedTask is defined but not yet started
Projects
Status
No status