Docker deployment setup - #21
Open
ramonechen wants to merge 26 commits into
Open
Conversation
There was a problem hiding this comment.
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
.envtemplate 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.
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.
jzgom067
requested changes
Apr 30, 2026
|
|
||
| ### 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. |
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.envfile, and run adocker compose runcommand..githubrepository, which creates a data volume that persists between environment start/stops.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.dockerignoregives 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.ymlenables 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.