-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.production.yml
37 lines (34 loc) · 1.01 KB
/
docker-compose.production.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
version: '3.8'
# This uses a production release of the application that can be tested locally.
# You'll need to run `docker compose exec postgres bash -c "pg_dump -U [YOURDBNAME] -d [YOURUSERNAME] > /backups/backup.sql"`
# to create a backup of your local postgres database before running this.
services:
web:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
environment:
- "MIX_ENV=${MIX_ENV:-prod}"
- "NODE_ENV=${NODE_ENV:-production}"
ports:
- "${DOCKER_WEB_PORT_FORWARD:-0.0.0.0:8000}:${PORT:-8000}"
depends_on:
postgres:
condition: service_healthy
postgres:
image: "postgres:16.0-bookworm"
environment:
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./.backups:/backups
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 5s
timeout: 5s
retries: 5
volumes:
postgres_data: