Add Docker configuration for port 3500

- Add Dockerfile with multi-stage build for production
- Add docker-compose.yml for easy deployment
- Add .dockerignore to exclude unnecessary files
- Add DOCKER_SETUP.md with comprehensive setup guide
- Update next.config.js to enable standalone output mode
- Configure app to run on port 3500
- Keep MySQL server external to Docker
This commit is contained in:
2025-12-02 10:09:13 +00:00
parent b2a59eecf1
commit 0d26087049
5 changed files with 265 additions and 0 deletions

43
docker-compose.yml Normal file
View File

@@ -0,0 +1,43 @@
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "3500:3500"
environment:
- NODE_ENV=production
- DATABASE_URL=${DATABASE_URL}
- NEXTAUTH_URL=${NEXTAUTH_URL:-http://localhost:3500}
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
- AUTH_SECRET=${AUTH_SECRET}
restart: unless-stopped
depends_on:
- db-check
networks:
- app-network
# Health check service to ensure MySQL is accessible
db-check:
image: mysql:8.0
command: >
sh -c "
until mysqladmin ping -h$${DB_HOST} -P$${DB_PORT} -u$${DB_USER} -p$${DB_PASSWORD} --silent; do
echo 'Waiting for MySQL...';
sleep 2;
done;
echo 'MySQL is ready!';
"
environment:
- DB_HOST=${DB_HOST:-localhost}
- DB_PORT=${DB_PORT:-3306}
- DB_USER=${DB_USER:-root}
- DB_PASSWORD=${DB_PASSWORD}
networks:
- app-network
networks:
app-network:
driver: bridge