mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-04-06 08:05:55 -04:00
- Added a production-ready `Dockerfile` based on Ruby 3.3.8-bullseye. - Added `entrypoint.sh` to handle Rails server PID cleanup. - Added `.dockerignore` to optimize build context. - Added `docker-compose.yml` for local orchestration of Rails, PostgreSQL 17, and Elasticsearch 7.4.0. - Added GitHub Actions workflow in `.github/workflows/docker-build-push.yml` to build and push the image to GHCR on pushes to the `dev` branch. Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
77 lines
1.9 KiB
YAML
77 lines
1.9 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
web:
|
|
build: .
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
elasticsearch:
|
|
condition: service_healthy
|
|
environment:
|
|
DATABASE_URL: postgresql://postgres:postgres@db:5432/growstuff_prod
|
|
ELASTICSEARCH_URL: http://elasticsearch:9200/
|
|
RAILS_ENV: production
|
|
RAILS_LOG_TO_STDOUT: "true"
|
|
RAILS_SERVE_STATIC_FILES: "true"
|
|
APP_DOMAIN_NAME: localhost:3000
|
|
APP_PROTOCOL: http
|
|
DEVISE_SECRET_KEY: secret
|
|
GROWSTUFF_EMAIL: "noreply@test.growstuff.org"
|
|
GROWSTUFF_FLICKR_KEY: secretkey
|
|
GROWSTUFF_FLICKR_SECRET: secretsecret
|
|
GROWSTUFF_SITE_NAME: "Growstuff (local)"
|
|
RAILS_SECRET_TOKEN: supersecret
|
|
SECRET_KEY_BASE: supersecretbase
|
|
|
|
db:
|
|
image: postgres:17
|
|
restart: unless-stopped
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
- .devcontainer/create-db-user.sql:/docker-entrypoint-initdb.d/create-db-user.sql
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_DB: growstuff_prod
|
|
POSTGRES_PASSWORD: postgres
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
elasticsearch:
|
|
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.0
|
|
container_name: elasticsearch
|
|
restart: unless-stopped
|
|
environment:
|
|
- xpack.security.enabled=false
|
|
- discovery.type=single-node
|
|
ulimits:
|
|
memlock:
|
|
soft: -1
|
|
hard: -1
|
|
nofile:
|
|
soft: 65536
|
|
hard: 65536
|
|
cap_add:
|
|
- IPC_LOCK
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:9200 | grep tagline"]
|
|
interval: 10s
|
|
timeout: 10s
|
|
retries: 120
|
|
volumes:
|
|
- esdata01:/usr/share/elasticsearch/data
|
|
ports:
|
|
- 9200:9200
|
|
- 9300:9300
|
|
|
|
volumes:
|
|
postgres-data:
|
|
esdata01:
|