build: add Docker Compose setup for Dokploy deployment
- Multi-stage Dockerfile for Go backend (golang:1.25-alpine -> alpine:3) - Multi-stage Dockerfile for Next.js frontend (bun:1 -> node:22-alpine) - docker-compose.yml with backend + frontend services, health checks - Next.js standalone output + API rewrites to proxy /api/* to backend - .dockerignore files for both services - .env.example documenting required environment variables
This commit is contained in:
33
docker-compose.yml
Normal file
33
docker-compose.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
expose:
|
||||
- "8080"
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- PORT=8080
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8080/health"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 5s
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
ports:
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
backend:
|
||||
condition: service_healthy
|
||||
env_file:
|
||||
- .env
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
Reference in New Issue
Block a user