Repository navigation
Expand file tree
/
Copy pathdocker-compose.docker-app.yml
More file actions
60 lines (58 loc) · 2.24 KB
/
Copy pathdocker-compose.docker-app.yml
File metadata and controls
60 lines (58 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Full local stack: docker-compose.dev.yml deps + Next.js production mode (`next start`).
#
# `next build` needs a live Postgres URL. Start Postgres first, then build — use:
# pnpm docker:app
# or manually:
# docker compose -f docker-compose.dev.yml up -d postgres redis mailhog minio svix
# docker compose --env-file .env.local -f docker-compose.docker-app.yml build web
# docker compose --env-file .env.local -f docker-compose.docker-app.yml up -d web
#
# Root `.env` supplies POSTGRES_PORT etc. for deps; `.env.local` supplies app secrets.
# Set DATABASE_URL_BUILD to match Postgres on the host (host.docker.internal + POSTGRES_PORT).
include:
- path: docker-compose.dev.yml
services:
web:
build:
context: .
dockerfile: Dockerfile
extra_hosts:
- "host.docker.internal:host-gateway"
args:
DATABASE_URL: ${DATABASE_URL_BUILD:-postgresql://postgres:postgres@host.docker.internal:5432/blank_saas}
NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL:-http://localhost:3000}
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: ${NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY:-}
NEXT_PUBLIC_POSTHOG_KEY: ${NEXT_PUBLIC_POSTHOG_KEY:-}
NEXT_PUBLIC_POSTHOG_HOST: ${NEXT_PUBLIC_POSTHOG_HOST:-}
NEXT_PUBLIC_FEATURE_GRANULAR_PERMISSIONS: ${NEXT_PUBLIC_FEATURE_GRANULAR_PERMISSIONS:-}
SITE_URL: ${SITE_URL:-}
ports:
- "${APP_PORT:-3000}:3000"
env_file:
- path: .env.local
required: false
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/blank_saas
REDIS_URL: redis://redis:6379
SMTP_HOST: mailhog
SMTP_PORT: "1025"
SMTP_SECURE: "false"
BETTER_AUTH_URL: ${NEXT_PUBLIC_APP_URL:-http://localhost:3000}
SVIX_SERVER_URL: http://svix:8071
S3_ENDPOINT: http://minio:9000
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
svix:
condition: service_started
mailhog:
condition: service_started
minio:
condition: service_started
restart: unless-stopped
command:
- sh
- -c
- "node --conditions=production node_modules/payload/bin.js migrate && exec node node_modules/next/dist/bin/next start -H 0.0.0.0 -p 3000"