Update docker-compose.yml

This commit is contained in:
NotII
2025-03-09 00:14:44 +00:00
parent 528d491549
commit 059e3b32e3

View File

@@ -1,36 +1,43 @@
version: '3'
version: '3.8'
services:
# Traefik reverse proxy
# Next.js Application Service
nextjs:
image: your-nextjs-image # Replace this with your custom Next.js Docker image
container_name: nextjs_app
build: .
environment:
- NEXT_PUBLIC_API_URL=https://internal-api.inboxi.ng/api
ports:
- "3000:3000" # Expose port 3000 for the Next.js application
labels:
- "traefik.enable=true"
- "traefik.http.routers.nextjs.rule=Host(`dash.embermarket.app`)" # Replace with your domain
- "traefik.http.services.nextjs.loadbalancer.server.port=3000" # Expose Next.js on port 3000
networks:
- web
# Traefik Reverse Proxy Service
traefik:
image: traefik:v2.9
image: traefik:v2.5
container_name: traefik
command:
- "--api.insecure=true" # Enable Traefik dashboard
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--providers.docker=true" # Enable Docker provider
- "--log.level=DEBUG" # Enable DEBUG level logs
- "--accesslog" # Enable access logs
- "--entrypoints.web.address=:80" # Listen on port 80
- "--entrypoints.websecure.address=:443" # Listen on port 443
ports:
- "80:80" # Expose HTTP port
- "443:443" # Expose HTTPS port
- "8080:8080" # Traefik Dashboard port (optional)
- "80:80" # Expose port 80
- "443:443" # Expose port 443
- "8080:8080" # Traefik Dashboard (ensure this is only exposed if secure)
volumes:
- "/var/run/docker.sock:/var/run/docker.sock" # Allow Traefik to monitor Docker
restart: unless-stopped
# Next.js application
nextjs-app:
build:
context: .
dockerfile: Dockerfile
container_name: nextjs-app-container
expose:
- "3000" # Expose Next.js app inside the Docker network
environment:
- NODE_ENV=production
- NEXT_PUBLIC_API_URL=https://internal-api.inboxi.ng/api
- "/var/run/docker.sock:/var/run/docker.sock" # Allow Traefik to interact with Docker
networks:
- web
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`dash.embermarket.app`)" # Use AEZA as reverse proxy
- "traefik.http.services.dashboard.loadbalancer.server.port=3000"
restart: unless-stopped
networks:
web:
external: true