Skip to content

Docker deployment setup - #21

Open
ramonechen wants to merge 26 commits into
main-previewfrom
deployment-setup
Open

Docker deployment setup#21
ramonechen wants to merge 26 commits into
main-previewfrom
deployment-setup

Conversation

@ramonechen

@ramonechen ramonechen commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

What?

This pull request "Dockerizes" the API repository and turns it into a service that runs as part of a larger Docker network for production.

The addition of a Docker Compose file also streamlines the development environment setup by removing the need to manually install dependencies and run multiple commands. Now, the only steps needed to start the development environment is to install Docker, create the .env file, and run a docker compose run command.

  • The Compose file pulls a MySQL database service definition from the organization's .github repository, which creates a data volume that persists between environment start/stops.
  • This volume can be shared with the SIS scraper's development environment, which uses the same MySQL database service.

A new GitHub Actions workflow has also been added to automatically build and publish a Docker image to the organization's GitHub Container Registry upon merging with the main branch.

These README has also been filled in to include instructions for development environment setup.

Why?

I wanted to learn Docker and use it to streamline both development and production processes across all of our repositories. This initiative massively simplifies development environment setup and deployment and reduces overall toil.

How?

The addition of docker-compose.yml, Dockerfile, and .dockerignore gives Docker the blueprint for both building the scraper into a Docker image for production and running the same image in a development environment.

The addition of .github/workflows/image-publish.yml enables automatic building and pushing of Docker images to the organization's GHCR.

Development environment setup instructions have also been added to README.md.

Testing?

The build process and development environment runs without issue across various cases.

Anything Else?

Have a nice day.

@ramonechen
ramonechen marked this pull request as ready for review April 28, 2026 23:53
Copilot AI review requested due to automatic review settings April 28, 2026 23:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Docker-based development and deployment scaffolding for the FastAPI service, including local Compose orchestration and GitHub Actions automation to publish a container image to GHCR.

Changes:

  • Add Docker build/runtime configuration (Dockerfile, .dockerignore) and a Compose-based dev environment.
  • Update environment variable handling by moving the example .env template to the repo root and updating settings loading.
  • Add/adjust GitHub Actions workflows for image publishing and Black formatting checks via reusable workflows.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
example.env New root-level environment variable template for .env.
docker-compose.yml Adds Compose dev environment with external included DB service and API service config.
app/example.env Removes old app-local .env template.
app/dependencies.py Updates settings to load .env from repo root and ignore extra env vars.
README.md Adds Docker-based development setup instructions.
Dockerfile Defines container build/run steps for the FastAPI app.
.github/workflows/image-publish.yml Adds reusable-workflow-based Docker image build/publish on main pushes.
.github/workflows/black-check.yml Switches Black check to a reusable workflow.
.dockerignore Limits Docker build context to required Python source and requirements.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docker-compose.yml Outdated
Comment thread docker-compose.yml Outdated
Comment thread docker-compose.yml
Comment thread .github/workflows/image-publish.yml
Comment thread .github/workflows/black-check.yml
Comment thread Dockerfile Outdated
Comment thread README.md
This is to allow live reloading to work correctly in development, while maintaining integrity of the production build.
With the docker run command, the watch directive is ignored. And I don't think it will be very often that the development environment will be kept running as a developer adds/removes dependencies from requirements.txt.
@ramonechen
ramonechen requested a review from mirmirmirr April 29, 2026 00:27
Comment thread README.md

### About the Database Environment

- **Shared Database:** The development environment pulls a shared MySQL database service definition from an external repository, creating a local database volume.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed, you should update this section to include the caveat of only one of the scraper and API being able to use the database container at once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants