38 lines
891 B
YAML
38 lines
891 B
YAML
|
version: '3'
|
||
|
|
||
|
services:
|
||
|
backend:
|
||
|
container_name: backend
|
||
|
env_file:
|
||
|
- .env
|
||
|
image: strapi/strapi:3.2.5-node12-alpine
|
||
|
restart: always
|
||
|
environment:
|
||
|
- NODE_ENV=production
|
||
|
- DATABASE_CLIENT=postgres
|
||
|
- DATABASE_HOST=${DATABASE_HOST}
|
||
|
- DATABASE_PORT=${DATABASE_PORT}
|
||
|
- DATABASE_NAME=${DATABASE_NAME}
|
||
|
- DATABASE_USERNAME=${DATABASE_USERNAME}
|
||
|
- DATABASE_PASSWORD=${DATABASE_PASSWORD}
|
||
|
ports:
|
||
|
- 1337:1337
|
||
|
volumes:
|
||
|
- ./backend:/srv/app
|
||
|
- ./build:/srv/app/public
|
||
|
depends_on:
|
||
|
- postgres-db
|
||
|
|
||
|
postgres-db:
|
||
|
container_name: postgres-db
|
||
|
env_file:
|
||
|
- .env
|
||
|
image: postgres:13
|
||
|
restart: always
|
||
|
volumes:
|
||
|
- ./db:/var/lib/postgresql/data
|
||
|
environment:
|
||
|
POSTGRES_USER: ${DATABASE_USERNAME}
|
||
|
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
|
||
|
POSTGRES_DB: ${DATABASE_NAME}
|