Files
omnivore/docker-compose.yml
2022-10-06 12:57:30 +08:00

152 lines
3.9 KiB
YAML

version: '3'
services:
postgres:
image: "postgres:12.8"
container_name: "omnivore-postgres"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=omnivore
- PG_POOL_MAX=20
healthcheck:
test: "exit 0"
interval: 2s
timeout: 12s
retries: 3
expose:
- 5432
migrate:
build:
context: .
dockerfile: ./packages/db/Dockerfile
container_name: "omnivore-migrate"
command: '/bin/sh ./packages/db/setup.sh'
environment:
- PGPASSWORD=postgres
- PG_HOST=postgres
- PG_USER=postgres
- PG_PASSWORD=postgres
- PG_DB=omnivore
- ELASTIC_URL=http://elastic:9200
- ELASTIC_USERNAME=blank
- ELASTIC_PASSWORD=blank
depends_on:
postgres:
condition: service_healthy
elastic:
condition: service_healthy
elastic:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.1
container_name: "omnivore-elastic"
healthcheck:
test: curl 0.0.0.0:9200/_cat/health >/dev/null || exit 1
interval: 2s
timeout: 2s
retries: 5
environment:
- discovery.type=single-node
- http.cors.allow-origin=*
- http.cors.enabled=true
- http.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
- http.cors.allow-credentials=true
volumes:
- ./.docker/elastic-data:/usr/share/elasticsearch/data
ports:
- "9200:9200"
kibana:
image: docker.elastic.co/kibana/kibana:7.17.1
container_name: "omnivore-kibana"
environment:
- ELASTICSEARCH_HOSTS=http://elastic:9200
depends_on:
- elastic
ports:
- "5601:5601"
redis:
image: "redis:6.2.7"
container_name: "omnivore-redis"
healthcheck:
test: "exit 0"
interval: 2s
timeout: 12s
retries: 3
ports:
- "6379:6379"
api:
build:
context: .
dockerfile: ./packages/api/Dockerfile
container_name: "omnivore-api"
ports:
- "4000:8080"
healthcheck:
test: ["CMD-SHELL", "nc -z 0.0.0.0 8080 || exit 1"]
interval: 15s
timeout: 90s
environment:
- API_ENV=local
- PG_HOST=postgres
- PG_USER=app_user
- PG_PASSWORD=app_pass
- PG_DB=omnivore
- PG_PORT=5432
- PG_POOL_MAX=20
- ELASTIC_URL=http://elastic:9200
- JAEGER_HOST=jaeger
- IMAGE_PROXY_URL=http://localhost:9999
- IMAGE_PROXY_SECRET=some-secret
- JWT_SECRET=some_secret
- SSO_JWT_SECRET=some_sso_secret
- CLIENT_URL=http://localhost:3000
- GATEWAY_URL=http://localhost:8080/api
- CONTENT_FETCH_URL=http://content-fetch:8080/?token=some_token
- REMINDER_TASK_HANDLER_URL=/svc/reminders/trigger
depends_on:
migrate:
condition: service_completed_successfully
elastic:
condition: service_healthy
redis:
condition: service_healthy
web:
build:
context: .
dockerfile: ./packages/web/Dockerfile
args:
- APP_ENV=prod
- BASE_URL=http://localhost:3000
- SERVER_BASE_URL=http://localhost:4000
- HIGHLIGHTS_BASE_URL=http://localhost:3000
container_name: "omnivore-web"
ports:
- "3000:8080"
environment:
- NEXT_PUBLIC_APP_ENV=prod
- NEXT_PUBLIC_BASE_URL=http://localhost:3000
- NEXT_PUBLIC_SERVER_BASE_URL=http://localhost:4000
- NEXT_PUBLIC_HIGHLIGHTS_BASE_URL=http://localhost:3000
depends_on:
api:
condition: service_healthy
content-fetch:
build:
context: .
dockerfile: ./packages/content-fetch/Dockerfile
container_name: "omnivore-content-fetch"
ports:
- "9090:8080"
environment:
- JWT_SECRET=some_secret
- VERIFICATION_TOKEN=some_token
- REST_BACKEND_ENDPOINT=http://api:8080/api
depends_on:
api:
condition: service_healthy