Initial commit.
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
# Local development overrides.
|
||||
# Compose merges this file on top of docker-compose.yml automatically, so a plain `docker compose up` builds from
|
||||
# source instead of pulling a registry image:
|
||||
#
|
||||
# docker compose up --build # build locally and run
|
||||
# docker compose up -d # reuse the last local build
|
||||
#
|
||||
# It reuses the `image:` name from the base file, so the local build is tagged the same way the production image would
|
||||
# be.
|
||||
services:
|
||||
website:
|
||||
image: ${IMAGE_NAME}:${IMAGE_TAG:-latest}
|
||||
# The local build targets the development machine, not the deployment: this cancels the base file's
|
||||
# ${IMAGE_PLATFORM}. Set BUILD_PLATFORM=linux/amd64 in .env when developing on an Intel Mac or an amd64 Linux box.
|
||||
platform: ${BUILD_PLATFORM:-linux/arm64}
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: Services/Website/Dockerfile
|
||||
environment:
|
||||
LOG_LEVEL: debug
|
||||
DATABASE_DRIVER: ${DATABASE_DRIVER:-inMemory}
|
||||
DATABASE_HOST: postgres
|
||||
DATABASE_TLS: ${DATABASE_TLS:-off}
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
required: false
|
||||
|
||||
# Local development database, started only with the `database` profile so a plain `docker compose up` still runs the
|
||||
# in-memory backend:
|
||||
#
|
||||
# docker compose --profile database up postgres
|
||||
postgres:
|
||||
image: postgres:18
|
||||
container_name: ${HOST_OWNER:-ccn}-db
|
||||
restart: unless-stopped
|
||||
profiles:
|
||||
- database
|
||||
ports:
|
||||
- "127.0.0.1:${DATABASE_PORT:-5432}:5432"
|
||||
environment:
|
||||
POSTGRES_DB: ${DATABASE_NAME:-ccn}
|
||||
POSTGRES_USER: ${DATABASE_USERNAME:-ccn}
|
||||
POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-ccn}
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready --username=$${POSTGRES_USER} --dbname=$${POSTGRES_DB}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 30s
|
||||
volumes:
|
||||
- ./Tests/DB:/var/lib/postgresql
|
||||
Reference in New Issue
Block a user