117 lines
2.6 KiB
YAML
117 lines
2.6 KiB
YAML
x-environment: &common-env
|
|
WEBSITES_READONLY: "${READONLY:-0}"
|
|
|
|
services:
|
|
websites:
|
|
build:
|
|
dockerfile: Dockerfile
|
|
context: .
|
|
image: websites4
|
|
command: foreman start -f Procfile
|
|
volumes:
|
|
- .:/app
|
|
- /var/www/e621-thumbnails:/data/e621-thumbnails
|
|
- /var/www/oceanic-docs:/data/oceanic-docs
|
|
tmpfs:
|
|
- /app/tmp/pids
|
|
environment:
|
|
<<: *common-env
|
|
RAILS_ENV: production
|
|
depends_on:
|
|
postgres:
|
|
condition: service_started
|
|
redis:
|
|
condition: service_started
|
|
labels:
|
|
- "hostname=websites4.containers.local"
|
|
tty: true
|
|
|
|
postgres:
|
|
image: postgres:14-alpine
|
|
volumes:
|
|
- ./data/postgres:/var/lib/postgresql/data
|
|
restart: unless-stopped
|
|
environment:
|
|
- POSTGRES_USER=websites
|
|
- POSTGRES_DB=websites
|
|
- POSTGRES_HOST_AUTH_METHOD=trust
|
|
healthcheck:
|
|
interval: 5s
|
|
timeout: 2s
|
|
test: pg_isready -U websites
|
|
hostname: postgres.websites4.containers.local
|
|
labels:
|
|
- "hostname=postgres.websites4.containers.local"
|
|
networks:
|
|
- default
|
|
|
|
redis:
|
|
image: redis:alpine
|
|
command: redis-server --save 10 1 --loglevel warning
|
|
volumes:
|
|
- ./data/redis:/data
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: redis-cli ping
|
|
interval: 10s
|
|
timeout: 5s
|
|
hostname: redis.websites4.containers.local
|
|
labels:
|
|
- "hostname=redis.websites4.containers.local"
|
|
networks:
|
|
- default
|
|
|
|
imgen:
|
|
image: ghcr.io/donovandmc/imgen
|
|
init: true
|
|
volumes:
|
|
- ./docker/imgen:/app
|
|
restart: always
|
|
healthcheck:
|
|
interval: 10s
|
|
timeout: 2s
|
|
test: lsof -i :3621 || exit 1
|
|
depends_on:
|
|
rethinkdb:
|
|
condition: service_started
|
|
redis:
|
|
condition: service_healthy
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 256M
|
|
cpus: "1"
|
|
environment:
|
|
<<: *common-env
|
|
hostname: imgen.websites4.containers.local
|
|
labels:
|
|
- "hostname=imgen.websites4.containers.local"
|
|
|
|
rethinkdb:
|
|
image: rethinkdb
|
|
command: rethinkdb --bind all -n rdb
|
|
container_name: rethinkdb.websites4
|
|
volumes:
|
|
- ./data/rethink:/data
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 256M
|
|
reservations:
|
|
memory: 64M
|
|
restart: always
|
|
hostname: rethinkdb.websites4.containers.local
|
|
labels:
|
|
- "hostname=rethinkdb.websites4.containers.local"
|
|
networks:
|
|
- default
|
|
|
|
networks:
|
|
default:
|
|
name: websites4
|
|
driver: bridge
|
|
ipam:
|
|
driver: default
|
|
config:
|
|
- subnet: 172.19.3.64/27
|