Update docker-compose.yml
This commit is contained in:
@@ -1,36 +1,43 @@
|
|||||||
version: '3'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
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:
|
traefik:
|
||||||
image: traefik:v2.9
|
image: traefik:v2.5
|
||||||
container_name: traefik
|
container_name: traefik
|
||||||
command:
|
command:
|
||||||
- "--api.insecure=true" # Enable Traefik dashboard
|
- "--api.insecure=true" # Enable Traefik dashboard
|
||||||
- "--entrypoints.web.address=:80"
|
- "--log.level=DEBUG" # Enable DEBUG level logs
|
||||||
- "--entrypoints.websecure.address=:443"
|
- "--accesslog" # Enable access logs
|
||||||
- "--providers.docker=true" # Enable Docker provider
|
- "--entrypoints.web.address=:80" # Listen on port 80
|
||||||
|
- "--entrypoints.websecure.address=:443" # Listen on port 443
|
||||||
ports:
|
ports:
|
||||||
- "80:80" # Expose HTTP port
|
- "80:80" # Expose port 80
|
||||||
- "443:443" # Expose HTTPS port
|
- "443:443" # Expose port 443
|
||||||
- "8080:8080" # Traefik Dashboard port (optional)
|
- "8080:8080" # Traefik Dashboard (ensure this is only exposed if secure)
|
||||||
volumes:
|
volumes:
|
||||||
- "/var/run/docker.sock:/var/run/docker.sock" # Allow Traefik to monitor Docker
|
- "/var/run/docker.sock:/var/run/docker.sock" # Allow Traefik to interact with Docker
|
||||||
restart: unless-stopped
|
networks:
|
||||||
|
- web
|
||||||
# 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
|
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "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"
|
networks:
|
||||||
restart: unless-stopped
|
web:
|
||||||
|
external: true
|
||||||
|
|||||||
Reference in New Issue
Block a user