58 lines
1.7 KiB
YAML
58 lines
1.7 KiB
YAML
version: '3'
|
|
|
|
services:
|
|
db:
|
|
image: postgres:alpine
|
|
container_name: "cms-postgres"
|
|
hostname: "postgres"
|
|
networks:
|
|
- cms
|
|
volumes:
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
- ./postgres:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_INITDB_ARGS=--auth-local=scram-sha-256 --auth-host=scram-sha-256 --locale=en_US.UTF-8
|
|
- POSTGRES_DB=${DATABASE_NAME:-cms}
|
|
- POSTGRES_USER=${DATABASE_USERNAME:-postgres}
|
|
- POSTGRES_PASSWORD=${DATABASE_PASSWORD:-password}
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready", "-q", "-U", "${DATABASE_USERNAME:-postgres}", "-d", "${DATABASE_NAME:-cms}"]
|
|
interval: 1s
|
|
timeout: 5s
|
|
retries: 10
|
|
restart: unless-stopped
|
|
|
|
cms:
|
|
build:
|
|
context: ./strapi
|
|
dockerfile: Dockerfile
|
|
args:
|
|
- APP_DIRECTORY=${APP_DIRECTORY:-/opt/strapi}
|
|
- NODE_ENV=${NODE_ENV:-18}
|
|
- STRAPI_ADMIN_BACKEND_URL=${STRAPI_ADMIN_BACKEND_URL:-https://strapi.enderman.ch}
|
|
- ADMIN_PATH=${ADMIN_PATH:-dashboard}
|
|
image: endermanch/strapi
|
|
container_name: "cms-strapi"
|
|
hostname: "strapi"
|
|
networks:
|
|
- cms
|
|
volumes:
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
- ./strapi/package.json:${APP_DIRECTORY:-/opt/strapi}/app/package.json
|
|
- ./strapi/src:${APP_DIRECTORY:-/opt/strapi}/app/src
|
|
- ./strapi/config:${APP_DIRECTORY:-/opt/strapi}/app/config
|
|
- ./strapi/public:${APP_DIRECTORY:-/opt/strapi}/app/public
|
|
ports:
|
|
- '127.0.0.1:3684:${PORT:-1337}'
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
- db
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
cms:
|
|
driver: bridge
|