-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Problem
Currently, the application must be manually deployed to any target environment. There is no Dockerfile for the application, and no automated process to push code from the repository to a running instance. This leads to configuration drift and slow release cycles.
Proposed Solution
Implement a CD pipeline using GitHub Actions that builds a Docker image of the application and deploys it to a target hosting environment (e.g., AWS, GCP, or a VPS). This will include creating a production-ready Dockerfile.
User Stories
- As a developer, I want my changes to be automatically deployed to a staging environment after passing CI tests.
- As a maintainer, I want a reliable, reproducible way to package and deploy the application.
Acceptance Criteria
-
Dockerfileand.dockerignoreare created for the FastAPI application. - GitHub Actions workflow file
.github/workflows/cd.ymlis created. - Workflow triggers on successful completion of the CI workflow on the
mainbranch. - Build Step: Builds a Docker image and pushes it to a container registry (e.g., Docker Hub, ECR).
- Deploy Step: Deploys the new image to the target environment (e.g., via SSH, Terraform, or cloud-specific actions).
- Health Check: Workflow verifies the deployment with a health check request.
- Production environment variables are securely managed via GitHub Secrets.
Proposed Technical Details
- Use multi-stage Docker builds to keep the image size small.
- Use
actions/checkout@v4,docker/setup-buildx-action@v3, anddocker/login-action@v3. - Configure the workflow to use repository secrets for sensitive data (API keys, DB URLs).
- Ensure the database migrations (
alembic upgrade head) are part of the deployment process.
Tasks
- Create a production-ready
Dockerfile. - Create
.dockerignoreto exclude development files. - Initialize
.github/workflows/cd.yml. - Setup container registry credentials in GitHub Secrets.
- Implement image build and push logic.
- Implement deployment logic (e.g.,
docker-compose up -don a remote server). - Document the CD process in the project's README or a new
DEPLOYMENT.md.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels