mirror of
https://github.com/arthur-pbty/contact.git
synced 2026-08-01 20:28:36 +02:00
add runner
This commit is contained in:
+18
-26
@@ -3,6 +3,8 @@ services:
|
||||
image: postgres:16-alpine
|
||||
container_name: contact-postgres
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-contact}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-contact}
|
||||
@@ -12,43 +14,33 @@ services:
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
|
||||
contact-dev:
|
||||
profiles: ["dev"]
|
||||
contact:
|
||||
build:
|
||||
context: .
|
||||
target: dev
|
||||
container_name: contact-dev
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- .:/app
|
||||
- /app/node_modules
|
||||
- /app/.next
|
||||
environment:
|
||||
NEXT_TELEMETRY_DISABLED: "1"
|
||||
DATABASE_URL: ${DATABASE_URL_DOCKER:-postgresql://contact:change-this-db-password@postgres:5432/contact}
|
||||
ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
|
||||
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-change-this-admin-password}
|
||||
ADMIN_SESSION_SECRET: ${ADMIN_SESSION_SECRET:-change-this-session-secret}
|
||||
depends_on:
|
||||
- postgres
|
||||
dockerfile: Dockerfile
|
||||
|
||||
container_name: contact
|
||||
|
||||
contact-prod:
|
||||
profiles: ["prod"]
|
||||
build:
|
||||
context: .
|
||||
target: runner
|
||||
container_name: contact-prod
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3018:3000"
|
||||
- "${APP_PORT}:3000"
|
||||
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
NEXT_TELEMETRY_DISABLED: "1"
|
||||
DATABASE_URL: ${DATABASE_URL_DOCKER:-postgresql://contact:change-this-db-password@postgres:5432/contact}
|
||||
|
||||
restart: unless-stopped
|
||||
|
||||
depends_on:
|
||||
- postgres
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 20s
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
|
||||
Reference in New Issue
Block a user