-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·52 lines (50 loc) · 1.38 KB
/
docker-compose.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
version: '3'
services:
strapi:
container_name: strapi
build:
context: .
args:
NODE_ENV: ${NODE_ENV}
image: strapi:latest
restart: unless-stopped
env_file: .env
read_only: true
environment:
DATABASE_CLIENT: ${DATABASE_CLIENT}
DATABASE_HOST: strapiDB # Override the DATABASE_HOST to use the service name
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_USERNAME: ${DATABASE_USERNAME}
DATABASE_PORT: 5432 # Override the DATABASE_PORT to use the container port
JWT_SECRET: ${JWT_SECRET}
ADMIN_JWT_SECRET: ${ADMIN_JWT_SECRET}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
NODE_ENV: ${NODE_ENV}
API_TOKEN_SALT: ${API_TOKEN_SALT}
APP_KEYS: ${APP_KEYS}
volumes:
- ./config:/opt/app/config
- ./src:/opt/app/src
- ./package.json:/opt/package.json
- ./package-lock.lock:/opt/package-lock.lock
- ./.env:/opt/app/.env
- ./public:/opt/app/public
ports:
- '1337:1337'
depends_on:
- strapiDB
strapiDB:
image: postgres:14-alpine
container_name: strapiDB
restart: unless-stopped
env_file: .env
environment:
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_DB: ${DATABASE_NAME}
volumes:
- strapi-data:/var/lib/postgresql/data/
ports:
- '5431:5432'
volumes:
strapi-data: