Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
npm-debug.log
.git
.gitignore
.parcel-cache
dist
*.md
.DS_Store
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Build stage
FROM node:18-slim as builder

WORKDIR /app

# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm ci

# Copy source code
COPY . .

# Build the application
RUN npm run build

# Production stage
FROM nginx:alpine

# Copy built files from builder stage
COPY --from=builder /app/dist /usr/share/nginx/html

# Copy nginx configuration (optional - uses default if not provided)
# COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
9 changes: 9 additions & 0 deletions docker-compose.simple.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3.8'

services:
connections-game:
image: ghcr.io/slmingol/react-connections-game:latest
container_name: react-connections-game
ports:
- "3000:80"
restart: unless-stopped
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3.8'

services:
connections-game:
build:
context: .
dockerfile: Dockerfile
container_name: react-connections-game
ports:
- "3000:80"
restart: unless-stopped
environment:
- NODE_ENV=production

# Development service (optional - uncomment to use)
# connections-game-dev:
# image: node:18-alpine
# container_name: react-connections-game-dev
# working_dir: /app
# volumes:
# - .:/app
# - /app/node_modules
# ports:
# - "1234:1234"
# command: sh -c "npm install && npm run dev"
# environment:
# - NODE_ENV=development
# restart: unless-stopped
Loading