-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
67 lines (63 loc) · 1.63 KB
/
docker-compose.yml
File metadata and controls
67 lines (63 loc) · 1.63 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
61
62
63
64
65
66
67
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:16-alpine
container_name: strapi-db
restart: unless-stopped
environment:
POSTGRES_USER: ${DATABASE_USERNAME:-strapi}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-strapi}
POSTGRES_DB: ${DATABASE_NAME:-strapi}
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- strapi-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USERNAME:-strapi}"]
interval: 10s
timeout: 5s
retries: 5
# Strapi Application
strapi:
build:
context: .
dockerfile: Dockerfile
target: production
container_name: strapi-app
restart: unless-stopped
environment:
NODE_ENV: ${NODE_ENV:-production}
DATABASE_CLIENT: postgres
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_NAME: ${DATABASE_NAME:-strapi}
DATABASE_USERNAME: ${DATABASE_USERNAME:-strapi}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-strapi}
DATABASE_SSL: ${DATABASE_SSL:-false}
JWT_SECRET: ${JWT_SECRET}
ADMIN_JWT_SECRET: ${ADMIN_JWT_SECRET}
APP_KEYS: ${APP_KEYS}
API_TOKEN_SALT: ${API_TOKEN_SALT}
TRANSFER_TOKEN_SALT: ${TRANSFER_TOKEN_SALT}
HOST: ${HOST:-0.0.0.0}
PORT: ${PORT:-1337}
volumes:
- strapi-uploads:/app/public/uploads
ports:
- "1337:1337"
networks:
- strapi-network
depends_on:
postgres:
condition: service_healthy
volumes:
postgres-data:
driver: local
strapi-uploads:
driver: local
networks:
strapi-network:
driver: bridge