Listory/docker-compose.yml

90 lines
2.2 KiB
YAML
Raw Normal View History

2020-01-25 22:19:14 +01:00
version: "3.4"
# Required for promtail scraping
x-logging: &default-logging
driver: "journald"
options:
tag: "{{.Name}}"
2020-01-25 22:19:14 +01:00
services:
db:
image: postgres:14.5
2020-01-25 22:19:14 +01:00
environment:
POSTGRES_PASSWORD: listory
POSTGRES_USER: listory
POSTGRES_DB: listory
networks:
2020-01-26 19:07:15 +01:00
- db
2020-01-25 22:19:14 +01:00
2020-01-26 19:07:15 +01:00
api:
2020-01-25 22:19:14 +01:00
build:
context: .
2020-01-26 19:07:15 +01:00
target: build-api
2020-01-25 22:19:14 +01:00
command: ["npm", "run", "start:dev"]
environment:
2020-05-03 03:47:24 +02:00
DB_HOST: db
2020-01-25 22:19:14 +01:00
DB_USERNAME: listory
DB_PASSWORD: listory
2020-05-03 03:47:24 +02:00
DB_DATABASE: listory
2020-05-03 20:57:03 +02:00
JWT_SECRET: listory
2020-05-03 03:47:24 +02:00
APP_URL: "http://localhost:3000"
NODE_ENV: local # pretty logs
OTEL_EXPORTER_OTLP_ENDPOINT: http://tempo:55681/v1/traces
2020-01-25 22:19:14 +01:00
env_file: .env
volumes:
- ./src:/app/src
ports:
- 3000 # API
- "9464:9464" # Metrics
2020-01-26 19:07:15 +01:00
labels:
- "traefik.enable=true" # Enable reverse-proxy for this service
2020-02-01 16:11:48 +01:00
- "traefik.http.routers.api.rule=PathPrefix(`/api`)"
2020-01-26 19:07:15 +01:00
- "traefik.http.routers.api.entrypoints=web"
2020-01-25 22:19:14 +01:00
networks:
2020-01-26 19:07:15 +01:00
- web
- db
logging: *default-logging
2020-01-26 19:07:15 +01:00
frontend:
build:
context: .
target: build-frontend
command: ["npm", "run", "start"]
volumes:
- ./frontend/postcss.config.js:/app/frontend/postcss.config.js:ro
- ./frontend/tailwind.config.js:/app/frontend/tailwind.config.js:ro
- ./frontend/src:/app/frontend/src:ro
- ./frontend/public:/app/frontend/public:ro
2020-01-26 19:07:15 +01:00
ports:
- 3000
labels:
- "traefik.enable=true" # Enable reverse-proxy for this service
- "traefik.http.routers.frontend.rule=PathPrefix(`/`)"
- "traefik.http.routers.frontend.entrypoints=web"
networks:
- web
proxy:
image: traefik:v2.8.5
2020-01-26 19:07:15 +01:00
command:
2020-02-01 16:11:48 +01:00
#- --log.level=debug
2020-01-26 19:07:15 +01:00
#- --accesslog=true
- --api # Enables the web UI
- --api.insecure=true
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.docker.network=listory_web
- --entrypoints.web.address=:3000
ports:
- "3000:3000" # The HTTP port
- "8080:8080" # The web UI
networks:
- web
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
2020-01-25 22:19:14 +01:00
networks:
2020-01-26 19:07:15 +01:00
db: {}
web: {}