Skip to content

[FEAT] Add Dockerfile for API#59

Merged
martian56 merged 1 commit into
mainfrom
58-add-dockerfile-for-api
Mar 24, 2026
Merged

[FEAT] Add Dockerfile for API#59
martian56 merged 1 commit into
mainfrom
58-add-dockerfile-for-api

Conversation

@martian56
Copy link
Copy Markdown
Member

This pull request adds initial Docker support for the API service by introducing a production-ready Dockerfile and a corresponding .dockerignore file. These changes enable efficient and secure containerization of the Go application.

Docker support and containerization:

  • Added a .dockerignore file to exclude unnecessary files and directories (such as .git, IDE settings, environment files, and documentation) from the Docker build context, improving build performance and security.
  • Created a multi-stage Dockerfile for building and running the Go API:
    • Uses a Go builder stage to compile the application.
    • Produces a minimal Alpine-based runtime image with only the compiled binary and migration files.
    • Sets up a non-root user, environment variables, and exposes port 8080 for the service.

Closes #58

@martian56 martian56 added this to the Deadline milestone Mar 24, 2026
@martian56 martian56 self-assigned this Mar 24, 2026
@martian56 martian56 added the API label Mar 24, 2026
Copilot AI review requested due to automatic review settings March 24, 2026 16:34
@nazarli-shabnam
Copy link
Copy Markdown
Member

Well done buds!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds initial containerization support for the Go API service by introducing a multi-stage Docker build and a reduced Docker build context, enabling the API to be built and run as a container image.

Changes:

  • Added api/Dockerfile with a multi-stage Go build and Alpine runtime stage (non-root user, migrations included, port 8080 exposed).
  • Added api/.dockerignore to exclude VCS/IDE files, binaries, and environment files from the Docker build context.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
api/Dockerfile Multi-stage build for compiling the Go API binary and packaging it with migrations into a minimal runtime image.
api/.dockerignore Reduces Docker build context to improve build performance and avoid copying local/dev artifacts.

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

Comment thread api/Dockerfile
Comment thread api/Dockerfile
Comment thread api/Dockerfile
@martian56 martian56 merged commit b1d4b51 into main Mar 24, 2026
11 checks passed
@martian56 martian56 deleted the 58-add-dockerfile-for-api branch May 2, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Dockerfile for API

3 participants