This document explains how to test and run the Docker setup locally.
- Docker and Docker Compose installed
- Node.js 14+ (for building admin panel locally if needed)
- Node.js 22+ (for building server and end_user locally if needed)
We provide a helper script that handles everything:
# Make sure the script is executable (first time only)
chmod +x scripts/docker-local.sh
# Run the script
./scripts/docker-local.shThis script will:
- Build admin panel static files if needed
- Create necessary directories
- Build and start all Docker services
Use the local docker-compose file that builds all images locally:
# Build admin panel static files first (required for nginx image)
cd admin_panel
npm install
npm run generate
cd ..
# Build and start all services
docker-compose -f docker-compose.local.yaml up --build
# Or run in detached mode
docker-compose -f docker-compose.local.yaml up --build -d
# View logs
docker-compose -f docker-compose.local.yaml logs -f
# Stop services
docker-compose -f docker-compose.local.yaml downNote: The local compose file uses nginx.Dockerfile.local which automatically builds the admin panel, so you don't need to build it manually if using the script.
You can also build and test individual services:
# Build server
docker build -t goranee_v2_server:local -f server/Dockerfile ./server
# Build end_user
docker build -t goranee_v2_end_user:local -f end_user/Dockerfile ./end_user
# Build admin panel (requires static files to be built first)
cd admin_panel && npm install && npm run generate && cd ..
docker build -t goranee_v2_nginx:local -f nginx.Dockerfile .
# Then use docker-compose.local.yaml which will use these local imagesCreate a .env file in the root directory (optional, defaults are provided):
SERVER_ADMIN_EMAIL=admin@mail.com
SERVER_ADMIN_PASSWORD=admin
MONGODB_URL=mongodb://mongo:27017
NUXT_API_BASE_URL=/api/-
nginx: Reverse proxy on ports 80/443
- Routes
/api/*to server - Routes
/admin/*to static admin files - Routes
/*to end_user SSR
- Routes
-
server: API server on port 8081 (internal)
- Health check:
http://localhost:8081/health
- Health check:
-
end_user: Nuxt 4 SSR app on port 8080 (internal)
- Health check:
http://localhost:8080
- Health check:
-
mongo: MongoDB database on port 27017 (internal)
- Main site: http://localhost (or https://localhost if SSL is configured)
- Admin panel: http://localhost/admin
- API: http://localhost/api
- Server health: http://localhost/api/health
For local HTTPS testing, you'll need SSL certificates:
# Create SSL directories
mkdir -p nginx/ssl nginx/certbot
# Generate self-signed certificates (for testing only)
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout nginx/ssl/key.pem \
-out nginx/ssl/cert.pem \
-subj "/C=US/ST=State/L=City/O=Organization/CN=localhost"Make sure you've built the admin panel static files:
cd admin_panel
npm install
npm run generate
cd ..Check if MongoDB container is running:
docker-compose -f docker-compose.local.yaml ps mongo
docker-compose -f docker-compose.local.yaml logs mongoIf ports 80 or 443 are already in use, modify the ports in docker-compose.local.yaml:
ports:
- "8080:80" # Use port 8080 instead of 80
- "8443:443" # Use port 8443 instead of 443# Rebuild specific service
docker-compose -f docker-compose.local.yaml build server
docker-compose -f docker-compose.local.yaml up -d server
# Rebuild all services
docker-compose -f docker-compose.local.yaml up --buildFor production, use the main docker-compose.yaml file which pulls images from GitHub Container Registry. See the GitHub Actions workflow for automated deployment.