forked from nemanjam/nextjs-prisma-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
53 lines (51 loc) · 1.37 KB
/
docker-compose.prod.yml
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
version: '3.8'
services:
npb-app-prod:
image: npb-app-prod
container_name: npb-app-prod
# all that is needed to build prod live image
build:
context: .
dockerfile: Dockerfile.prod
# DATABASE_URL needed for static site generation - getStaticProps
# NEXTAUTH_URL needed for CustomHead SEO
args:
- ARG_DATABASE_URL=$DATABASE_URL
- ARG_NEXTAUTH_URL=$NEXTAUTH_URL
ports:
- '3001:3001'
#command: sleep infinity
volumes:
- ./uploads:/app/uploads
env_file:
- ./envs/production-docker/.env.production.docker
- ./envs/production-docker/.env.production.docker.local
depends_on:
- npb-db-prod
networks:
- proxy
- internal-prod
npb-db-prod:
image: postgres:14.3-bullseye
container_name: npb-db-prod
restart: unless-stopped
ports:
- '5432:5432'
user: '${MY_UID}:${MY_GID}'
volumes:
- ./prisma/pg-data:/var/lib/postgresql/data
# uncomment for external access
# - ./prisma/pg-config/pg_hba.conf:/etc/postgresql.conf
# - ./prisma/pg-config/postgresql.conf:/etc/pg_hba.conf
environment:
- PGDATA=/var/lib/postgresql/data/data-prod
env_file:
- ./envs/production-docker/.env.production.docker.local
networks:
- proxy
- internal-prod
networks:
proxy:
external: true
internal-prod:
external: false