Websites/docker-compose.prod.yml

139 lines
3.2 KiB
YAML
Raw Normal View History

2024-05-03 03:04:43 +00:00
x-environment: &common-env
WEBSITES_READONLY: "${READONLY:-0}"
services:
websites:
build:
dockerfile: Dockerfile
context: .
image: websites4
command: foreman start -f Procfile
restart: unless-stopped
2024-05-03 03:04:43 +00:00
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:
2024-05-03 05:29:17 +00:00
- ./data/postgres:/var/lib/postgresql/data
2024-05-03 03:04:43 +00:00
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:
2024-05-03 05:29:17 +00:00
- ./data/redis:/data
2024-05-03 03:04:43 +00:00
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
opensearch:
image: opensearchproject/opensearch:2.13.0
environment:
- discovery.type=single-node
- logger.level=WARN
- DISABLE_SECURITY_PLUGIN=true
- DISABLE_INSTALL_DEMO_CONFIG=true
- OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g
volumes:
- ./data/opensearch:/usr/share/opensearch/data
init: true
healthcheck:
interval: 5s
timeout: 2s
retries: 12
test: curl "opensearch:9200/_cluster/health?wait_for_status=yellow&timeout=2s"
hostname: opensearch.websites4.containers.local
labels:
- "hostname=opensearch.websites4.containers.local"
networks:
- default
2024-05-03 05:29:17 +00:00
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
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
2024-05-03 03:04:43 +00:00
networks:
default:
name: websites4
driver: bridge
ipam:
driver: default
config:
- subnet: 172.19.3.64/27