2023-10-11 09:36:43 +03:00
|
|
|
version: '3.7'
|
|
|
|
|
|
|
|
services:
|
2024-01-15 21:50:08 +03:00
|
|
|
tipi-docker-proxy:
|
|
|
|
container_name: tipi-docker-proxy
|
|
|
|
image: tecnativa/docker-socket-proxy
|
|
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
|
|
- socket_proxy
|
|
|
|
volumes:
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
|
|
environment:
|
|
|
|
POST: 1
|
|
|
|
CONTAINERS: 1
|
|
|
|
ALLOW_START: 1
|
|
|
|
ALLOW_STOP: 1
|
|
|
|
IMAGES: 1
|
|
|
|
NETWORKS: 1
|
|
|
|
|
2023-10-11 09:36:43 +03:00
|
|
|
tipi-reverse-proxy:
|
|
|
|
container_name: tipi-reverse-proxy
|
2024-01-15 21:50:08 +03:00
|
|
|
depends_on:
|
|
|
|
- tipi-docker-proxy
|
|
|
|
- tipi-dashboard
|
|
|
|
image: traefik:v2.11
|
|
|
|
restart: unless-stopped
|
2023-10-11 09:36:43 +03:00
|
|
|
ports:
|
|
|
|
- 80:80
|
|
|
|
- 443:443
|
|
|
|
- 8080:8080
|
|
|
|
command: --providers.docker
|
|
|
|
volumes:
|
2023-12-19 23:31:50 +03:00
|
|
|
- ./traefik:/root/.config
|
|
|
|
- ./traefik/shared:/shared
|
2023-10-11 09:36:43 +03:00
|
|
|
networks:
|
|
|
|
- tipi_main_network
|
2024-01-15 21:50:08 +03:00
|
|
|
- socket_proxy
|
2023-10-11 09:36:43 +03:00
|
|
|
|
|
|
|
tipi-db:
|
|
|
|
container_name: tipi-db
|
|
|
|
image: postgres:14
|
|
|
|
restart: unless-stopped
|
|
|
|
stop_grace_period: 1m
|
|
|
|
volumes:
|
|
|
|
- pgdata:/var/lib/postgresql/data
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
environment:
|
|
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
|
|
POSTGRES_USER: tipi
|
|
|
|
POSTGRES_DB: tipi
|
|
|
|
healthcheck:
|
|
|
|
test: ['CMD-SHELL', 'pg_isready -d tipi -U tipi']
|
|
|
|
interval: 5s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 120
|
|
|
|
networks:
|
|
|
|
- tipi_main_network
|
|
|
|
|
|
|
|
tipi-redis:
|
|
|
|
container_name: tipi-redis
|
|
|
|
image: redis:7.2.0
|
|
|
|
restart: unless-stopped
|
|
|
|
command: redis-server --requirepass ${REDIS_PASSWORD}
|
|
|
|
ports:
|
|
|
|
- 6379:6379
|
|
|
|
volumes:
|
|
|
|
- redisdata:/data
|
|
|
|
healthcheck:
|
|
|
|
test: ['CMD', 'redis-cli', 'ping']
|
|
|
|
interval: 5s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 120
|
|
|
|
networks:
|
|
|
|
- tipi_main_network
|
|
|
|
|
2023-11-15 14:14:34 +03:00
|
|
|
tipi-worker:
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: ./packages/worker/Dockerfile
|
2023-12-19 22:49:39 +03:00
|
|
|
args:
|
|
|
|
- SENTRY_DISABLE_AUTO_UPLOAD=true
|
2024-01-09 23:09:41 +03:00
|
|
|
- TIPI_VERSION=0.0.0
|
2023-11-15 14:14:34 +03:00
|
|
|
container_name: tipi-worker
|
|
|
|
healthcheck:
|
2024-01-20 14:33:55 +03:00
|
|
|
test: ['CMD', 'curl', '-f', 'http://localhost:3000/api/healthcheck']
|
2023-11-15 14:14:34 +03:00
|
|
|
interval: 5s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 120
|
|
|
|
start_period: 5s
|
|
|
|
depends_on:
|
|
|
|
tipi-db:
|
|
|
|
condition: service_healthy
|
|
|
|
tipi-redis:
|
|
|
|
condition: service_healthy
|
2024-01-15 21:50:08 +03:00
|
|
|
tipi-docker-proxy:
|
|
|
|
condition: service_started
|
2023-11-15 14:14:34 +03:00
|
|
|
env_file:
|
|
|
|
- .env
|
|
|
|
environment:
|
|
|
|
NODE_ENV: production
|
2024-01-09 23:09:41 +03:00
|
|
|
TIPI_VERSION: 0.0.0
|
2024-01-15 21:50:08 +03:00
|
|
|
DOCKER_HOST: tcp://tipi-docker-proxy:2375
|
2023-11-15 14:14:34 +03:00
|
|
|
volumes:
|
|
|
|
- /proc:/host/proc
|
2023-12-19 23:31:50 +03:00
|
|
|
- ./.env:/app/.env
|
|
|
|
- ./state:/app/state
|
|
|
|
- ./repos:/app/repos
|
|
|
|
- ./apps:/app/apps
|
|
|
|
- ./logs:/app/logs
|
|
|
|
- ./traefik:/app/traefik
|
|
|
|
- ./user-config:/app/user-config
|
|
|
|
- ${STORAGE_PATH:-.}:/storage
|
2023-11-15 14:14:34 +03:00
|
|
|
networks:
|
|
|
|
- tipi_main_network
|
2024-01-15 21:50:08 +03:00
|
|
|
- socket_proxy
|
2023-12-27 17:02:18 +03:00
|
|
|
labels:
|
|
|
|
traefik.enable: true
|
|
|
|
traefik.http.services.worker.loadbalancer.server.port: 3001
|
2024-01-20 14:33:55 +03:00
|
|
|
traefik.http.services.api.loadbalancer.server.port: 3000
|
2023-12-27 17:02:18 +03:00
|
|
|
traefik.http.middlewares.redirect-to-https.redirectscheme.scheme: https
|
|
|
|
# Local ip
|
|
|
|
traefik.http.routers.worker.rule: PathPrefix("/worker")
|
|
|
|
traefik.http.routers.worker.service: worker
|
|
|
|
traefik.http.routers.worker.entrypoints: web
|
2024-01-20 14:33:55 +03:00
|
|
|
traefik.http.routers.api.rule: PathPrefix("/api")
|
|
|
|
traefik.http.routers.api.service: api
|
|
|
|
traefik.http.routers.api.entrypoints: web
|
2023-12-27 17:02:18 +03:00
|
|
|
# Local domain
|
|
|
|
traefik.http.routers.worker-local-insecure.rule: Host(`${LOCAL_DOMAIN}`) && PathPrefix("/worker")
|
|
|
|
traefik.http.routers.worker-local-insecure.entrypoints: web
|
|
|
|
traefik.http.routers.worker-local-insecure.service: worker
|
|
|
|
traefik.http.routers.worker-local-insecure.middlewares: redirect-to-https
|
2024-01-20 14:33:55 +03:00
|
|
|
traefik.http.routers.api-local-insecure.rule: Host(`${LOCAL_DOMAIN}`) && PathPrefix("/api")
|
|
|
|
traefik.http.routers.api-local-insecure.entrypoints: web
|
|
|
|
traefik.http.routers.api-local-insecure.service: api
|
|
|
|
traefik.http.routers.api-local-insecure.middlewares: redirect-to-https
|
2023-12-27 17:02:18 +03:00
|
|
|
# secure
|
|
|
|
traefik.http.routers.worker-local.rule: Host(`${LOCAL_DOMAIN}`) && PathPrefix("/worker")
|
|
|
|
traefik.http.routers.worker-local.entrypoints: websecure
|
|
|
|
traefik.http.routers.worker-local.tls: true
|
|
|
|
traefik.http.routers.worker-local.service: worker
|
2024-01-20 14:33:55 +03:00
|
|
|
traefik.http.routers.api-local.rule: Host(`${LOCAL_DOMAIN}`) && PathPrefix("/api")
|
|
|
|
traefik.http.routers.api-local.entrypoints: websecure
|
|
|
|
traefik.http.routers.api-local.tls: true
|
2023-11-15 14:14:34 +03:00
|
|
|
|
2023-10-11 09:36:43 +03:00
|
|
|
tipi-dashboard:
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: Dockerfile
|
2023-12-10 21:28:52 +03:00
|
|
|
args:
|
|
|
|
- SENTRY_DISABLE_AUTO_UPLOAD=true
|
2024-01-09 23:09:41 +03:00
|
|
|
- TIPI_VERSION=0.0.0
|
2023-10-11 09:36:43 +03:00
|
|
|
container_name: tipi-dashboard
|
|
|
|
depends_on:
|
|
|
|
tipi-db:
|
|
|
|
condition: service_healthy
|
|
|
|
tipi-redis:
|
|
|
|
condition: service_healthy
|
2023-11-15 14:14:34 +03:00
|
|
|
tipi-worker:
|
|
|
|
condition: service_healthy
|
2023-10-11 09:36:43 +03:00
|
|
|
env_file:
|
|
|
|
- .env
|
|
|
|
environment:
|
2023-12-10 21:28:52 +03:00
|
|
|
NODE_ENV: production
|
2024-01-09 23:09:41 +03:00
|
|
|
TIPI_VERSION: 0.0.0
|
2023-10-11 09:36:43 +03:00
|
|
|
networks:
|
|
|
|
- tipi_main_network
|
|
|
|
ports:
|
|
|
|
- 3000:3000
|
|
|
|
volumes:
|
2023-12-19 23:31:50 +03:00
|
|
|
- ./.env:/runtipi/.env:ro
|
|
|
|
- ./state:/runtipi/state
|
|
|
|
- ./repos:/runtipi/repos:ro
|
|
|
|
- ./apps:/runtipi/apps
|
|
|
|
- ./logs:/app/logs
|
2023-12-21 14:28:07 +03:00
|
|
|
- ./traefik:/runtipi/traefik
|
2023-12-19 23:31:50 +03:00
|
|
|
- ${STORAGE_PATH:-.}:/app/storage
|
2023-10-11 09:36:43 +03:00
|
|
|
labels:
|
|
|
|
traefik.enable: true
|
|
|
|
traefik.http.services.dashboard.loadbalancer.server.port: 3000
|
|
|
|
traefik.http.middlewares.redirect-to-https.redirectscheme.scheme: https
|
2023-10-11 17:09:11 +03:00
|
|
|
# Local ip
|
|
|
|
traefik.http.routers.dashboard.rule: PathPrefix("/")
|
|
|
|
traefik.http.routers.dashboard.service: dashboard
|
|
|
|
traefik.http.routers.dashboard.entrypoints: web
|
2023-10-11 09:36:43 +03:00
|
|
|
# Local domain
|
|
|
|
traefik.http.routers.dashboard-local-insecure.rule: Host(`${LOCAL_DOMAIN}`)
|
|
|
|
traefik.http.routers.dashboard-local-insecure.entrypoints: web
|
|
|
|
traefik.http.routers.dashboard-local-insecure.service: dashboard
|
|
|
|
traefik.http.routers.dashboard-local-insecure.middlewares: redirect-to-https
|
|
|
|
# secure
|
|
|
|
traefik.http.routers.dashboard-local.rule: Host(`${LOCAL_DOMAIN}`)
|
|
|
|
traefik.http.routers.dashboard-local.entrypoints: websecure
|
|
|
|
traefik.http.routers.dashboard-local.tls: true
|
|
|
|
traefik.http.routers.dashboard-local.service: dashboard
|
|
|
|
|
|
|
|
networks:
|
|
|
|
tipi_main_network:
|
|
|
|
driver: bridge
|
|
|
|
name: runtipi_tipi_main_network
|
2024-01-15 21:50:08 +03:00
|
|
|
socket_proxy:
|
|
|
|
name: runtipi_socket_proxy
|
2023-10-11 09:36:43 +03:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
pgdata:
|
|
|
|
redisdata:
|