mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2026-07-31 07:49:07 -04:00
- Introduced a helper function to check if a hostname matches a given domain, improving the clarity of the `infer_source_from_url` function. - Updated the image source inference logic to utilize the new helper function for better maintainability. - Added a test case to ensure that spoofed hostnames do not match valid image sources, enhancing security and robustness of the inference logic. - Updated Docker Compose configuration to ensure the correct image is used for the backend service.
77 lines
1.8 KiB
YAML
77 lines
1.8 KiB
YAML
services:
|
|
web:
|
|
# build:
|
|
# context: ..
|
|
# dockerfile: docker/Dockerfile
|
|
# target: frontend
|
|
image: ghcr.io/seanmorley15/adventurelog-frontend:latest
|
|
container_name: adventurelog-frontend
|
|
restart: unless-stopped
|
|
env_file: ../.env.advanced
|
|
ports:
|
|
- "${FRONTEND_PORT:-8015}:3000"
|
|
depends_on:
|
|
server:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD",
|
|
"node",
|
|
"-e",
|
|
"fetch('http://127.0.0.1:3000/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
|
|
]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
db:
|
|
image: postgis/postgis:16-3.5
|
|
container_name: adventurelog-db
|
|
restart: unless-stopped
|
|
env_file: ../.env.advanced
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data/
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"pg_isready -U ${POSTGRES_USER:-adventure} -d ${POSTGRES_DB:-database}"
|
|
]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
|
|
server:
|
|
# build:
|
|
# context: ..
|
|
# dockerfile: docker/Dockerfile
|
|
# target: backend
|
|
image: ghcr.io/seanmorley15/adventurelog-backend:latest
|
|
container_name: adventurelog-backend
|
|
restart: unless-stopped
|
|
env_file: ../.env.advanced
|
|
ports:
|
|
- "${BACKEND_PORT:-8016}:80"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
- adventurelog_media:/code/media/
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"python -c \"import urllib.request; urllib.request.urlopen('http://localhost:80/health/')\""
|
|
]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 60s
|
|
|
|
volumes:
|
|
postgres_data:
|
|
adventurelog_media:
|