Websites/docker-compose.yml
2024-05-03 00:29:17 -05:00

121 lines
2.6 KiB
YAML

x-environment: &common-env
WEBSITES_READONLY: "${READONLY:-0}"
services:
websites:
build: .
image: websites4
volumes:
- .:/app
- e621_thumbnail_data:/data/e621-thumbnails
- oceanic_docs_data:/data/oceanic-docs
tmpfs:
- /app/tmp/pids
environment:
<<: *common-env
RAILS_ENV: development
depends_on:
postgres:
condition: service_started
redis:
condition: service_started
labels:
- "hostname=websites4.containers.local"
tty: true
postgres:
image: postgres:14-alpine
volumes:
- db_data:/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:
- redis_data:/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:
- rethinkdb_data:/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
volumes:
db_data:
redis_data:
e621_thumbnail_data:
oceanic_docs_data:
rethinkdb_data: