Skip to content

feat: Add Docker support with multi-stage build#5

Open
slmingol wants to merge 1 commit intoand-computers:mainfrom
slmingol:feature/docker-setup
Open

feat: Add Docker support with multi-stage build#5
slmingol wants to merge 1 commit intoand-computers:mainfrom
slmingol:feature/docker-setup

Conversation

@slmingol
Copy link
Copy Markdown

Overview

This PR adds comprehensive Docker support for the React Connections Game project.

Changes

  • Dockerfile: Multi-stage build using Node.js 18 (Debian-based) for building and Nginx Alpine for serving
  • docker-compose.yml: Full setup with local build capability and optional dev mode with hot-reload
  • docker-compose.simple.yml: Simplified setup for running from GitHub Container Registry
  • .dockerignore: Optimizes build context by excluding unnecessary files

Usage

Production Build (Local)

docker-compose up -d

Access at http://localhost:3000

From GHCR (once published)

docker-compose -f docker-compose.simple.yml up -d

Technical Notes

  • Uses Debian-based Node image (not Alpine) for ARM compatibility with Parcel's native modules
  • Multi-stage build keeps production image small - Multi-stage build keeps production image small - Multi-stage build keeps production image small - Multi-stage build keeps production image small - Multi-stage build keepom fork: https://github.com/slmingol/react-connections-game

- Add Dockerfile with Node.js build and Nginx production stages
- Add docker-compose.yml for local development with build
- Add docker-compose.simple.yml for running from GHCR
- Add .dockerignore to optimize build context
- Use Debian-based Node image for ARM compatibility
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.

2 participants