Skip to content

Commit

Permalink
local compose の設定
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-20 committed Jan 18, 2025
1 parent ff0e3a5 commit 42f8710
Showing 1 changed file with 70 additions and 68 deletions.
138 changes: 70 additions & 68 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ services:
- ./.local-dev/keys:/keys
- ~/.ssh/known_hosts:/root/.ssh/known_hosts
labels:
- "traefik.enable=true"
- "traefik.http.routers.ns-gateway.rule=Host(`ns.local.trapti.tech`) && PathPrefix(`/neoshowcase.protobuf.APIService`)"
- 'traefik.enable=true'
- 'traefik.http.routers.ns-gateway.rule=Host(`ns.local.trapti.tech`) && PathPrefix(`/neoshowcase.protobuf.APIService`)'
# - "traefik.http.routers.ns-gateway.middlewares=ns_auth@file"
- "traefik.http.routers.ns-gateway.middlewares=ns_auth_dev@file"
- "traefik.http.routers.ns-gateway.service=ns-gateway"
- "traefik.http.services.ns-gateway.loadbalancer.server.port=8080"
- 'traefik.http.routers.ns-gateway.middlewares=ns_auth_dev@file'
- 'traefik.http.routers.ns-gateway.service=ns-gateway'
- 'traefik.http.services.ns-gateway.loadbalancer.server.port=8080'
depends_on:
mysql:
condition: service_healthy
Expand All @@ -36,12 +36,12 @@ services:
- ./dashboard:/work
- /work/node_modules
labels:
- "traefik.enable=true"
- "traefik.http.routers.ns_dashboard.rule=Host(`ns.local.trapti.tech`)"
- 'traefik.enable=true'
- 'traefik.http.routers.ns_dashboard.rule=Host(`ns.local.trapti.tech`)'
# - "traefik.http.routers.ns_dashboard.middlewares=ns_auth@file"
- "traefik.http.routers.ns_dashboard.middlewares=ns_auth_dev@file"
- "traefik.http.routers.ns_dashboard.service=ns_dashboard"
- "traefik.http.services.ns_dashboard.loadbalancer.server.port=80"
- 'traefik.http.routers.ns_dashboard.middlewares=ns_auth_dev@file'
- 'traefik.http.routers.ns_dashboard.service=ns_dashboard'
- 'traefik.http.services.ns_dashboard.loadbalancer.server.port=80'
networks:
- default

Expand All @@ -68,14 +68,14 @@ services:
ns-migrate:
condition: service_completed_successfully
labels:
- "traefik.enable=true"
- "traefik.http.routers.ns_controller_webhook.rule=Host(`ns.local.trapti.tech`) && PathPrefix(`/api/webhook`)"
- "traefik.http.routers.ns_controller_webhook.service=ns_controller_webhook"
- "traefik.http.services.ns_controller_webhook.loadbalancer.server.port=8080"
- "traefik.tcp.routers.ns_controller.entrypoints=ns-ssh"
- "traefik.tcp.routers.ns_controller.rule=HostSNI(`*`)"
- "traefik.tcp.routers.ns_controller.service=ns_controller"
- "traefik.tcp.services.ns_controller.loadbalancer.server.port=2201"
- 'traefik.enable=true'
- 'traefik.http.routers.ns_controller_webhook.rule=Host(`ns.local.trapti.tech`) && PathPrefix(`/api/webhook`)'
- 'traefik.http.routers.ns_controller_webhook.service=ns_controller_webhook'
- 'traefik.http.services.ns_controller_webhook.loadbalancer.server.port=8080'
- 'traefik.tcp.routers.ns_controller.entrypoints=ns-ssh'
- 'traefik.tcp.routers.ns_controller.rule=HostSNI(`*`)'
- 'traefik.tcp.routers.ns_controller.service=ns_controller'
- 'traefik.tcp.services.ns_controller.loadbalancer.server.port=2201'
networks:
- default

Expand Down Expand Up @@ -105,10 +105,10 @@ services:
volumes:
- ./.local-dev/config/ns-auth.yaml:/config.yaml
labels:
- "traefik.enable=true"
- "traefik.http.routers.ns_auth.rule=Host(`auth.local.trapti.tech`)"
- "traefik.http.routers.ns_auth.service=ns_auth"
- "traefik.http.services.ns_auth.loadbalancer.server.port=4181"
- 'traefik.enable=true'
- 'traefik.http.routers.ns_auth.rule=Host(`auth.local.trapti.tech`)'
- 'traefik.http.routers.ns_auth.service=ns_auth'
- 'traefik.http.services.ns_auth.loadbalancer.server.port=4181'
networks:
- default

Expand All @@ -120,7 +120,7 @@ services:
restart: always
environment:
HEADER: X-Showcase-User
USER: "toki"
USER: 'toki'
networks:
- default

Expand Down Expand Up @@ -152,7 +152,7 @@ services:
context: .
target: ns
image: ghcr.io/traptitech/ns:main
restart: "no"
restart: 'no'
entrypoint: cp /app/ns /ns-bin
volumes:
- binary:/ns-bin
Expand Down Expand Up @@ -188,14 +188,14 @@ services:
deploy:
resources:
limits:
cpus: "1"
cpus: '1'

static-server:
image: caddy:2-alpine
restart: always
environment:
# Do not bind to all addresses in production!
CADDY_ADMIN: ":2019"
CADDY_ADMIN: ':2019'
volumes:
- ./.local-dev/staticsite/artifacts:/artifacts
networks:
Expand Down Expand Up @@ -225,13 +225,13 @@ services:
context: .
target: ns-migrate
image: ghcr.io/traptitech/ns-migrate:main
restart: "no"
restart: 'no'
environment:
DB_HOST: "mysql"
DB_PORT: "3306"
DB_USER: "root"
DB_PASS: "password"
DB_NAME: "neoshowcase"
DB_HOST: 'mysql'
DB_PORT: '3306'
DB_USER: 'root'
DB_PASS: 'password'
DB_NAME: 'neoshowcase'
depends_on:
mysql:
condition: service_healthy
Expand All @@ -242,36 +242,36 @@ services:
image: registry:2
restart: always
environment:
REGISTRY_STORAGE_DELETE_ENABLED: "true"
REGISTRY_STORAGE_DELETE_ENABLED: 'true'
REGISTRY_HTTP_ADDR: :80
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
GC_SCRIPT: /gc.sh
labels:
- "traefik.enable=true"
- "traefik.http.routers.registry.rule=Host(`registry.local`)"
- "traefik.http.services.registry.loadbalancer.server.port=80"
- 'traefik.enable=true'
- 'traefik.http.routers.registry.rule=Host(`registry.local`)'
- 'traefik.http.services.registry.loadbalancer.server.port=80'
volumes:
- ./.local-dev/registry/entrypoint.sh:/entrypoint.sh
- ./.local-dev/registry/gc.sh:/gc.sh
- ./.local-dev/registry-data:/var/lib/registry
networks:
default:
aliases:
- "registry.local"
- 'registry.local'

registry-frontend:
image: joxit/docker-registry-ui:2
restart: always
environment:
SINGLE_REGISTRY: "true"
SINGLE_REGISTRY: 'true'
REGISTRY_TITLE: registry.local
NGINX_PROXY_PASS_URL: http://registry.local
SHOW_CONTENT_DIGEST: "true"
DELETE_IMAGES: "true"
SHOW_CONTENT_DIGEST: 'true'
DELETE_IMAGES: 'true'
labels:
- "traefik.enable=true"
- "traefik.http.routers.registry_frontend.rule=Host(`registry-frontend.local.trapti.tech`)"
- "traefik.http.services.registry_frontend.loadbalancer.server.port=80"
- 'traefik.enable=true'
- 'traefik.http.routers.registry_frontend.rule=Host(`registry-frontend.local.trapti.tech`)'
- 'traefik.http.services.registry_frontend.loadbalancer.server.port=80'
networks:
- default

Expand All @@ -290,7 +290,7 @@ services:
volumes:
- ./.local-dev/mysql:/var/lib/mysql
ports:
- "5004:3306"
- '5004:3306'
networks:
- default
- apps
Expand All @@ -304,7 +304,7 @@ services:
volumes:
- ./.local-dev/mongo:/data/db
ports:
- "5010:27017"
- '5010:27017'
networks:
- default
- apps
Expand All @@ -316,19 +316,19 @@ services:
ADMINER_DEFAULT_SERVER: mysql
ADMINER_DESIGN: nette
labels:
- "traefik.enable=true"
- "traefik.http.routers.adminer.rule=Host(`adminer.local.trapti.tech`)"
- "traefik.http.services.adminer.loadbalancer.server.port=8080"
- 'traefik.enable=true'
- 'traefik.http.routers.adminer.rule=Host(`adminer.local.trapti.tech`)'
- 'traefik.http.services.adminer.loadbalancer.server.port=8080'
networks:
- default

grafana:
image: grafana/grafana:11.1.3
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.grafana.rule=Host(`grafana.local.trapti.tech`)"
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
- 'traefik.enable=true'
- 'traefik.http.routers.grafana.rule=Host(`grafana.local.trapti.tech`)'
- 'traefik.http.services.grafana.loadbalancer.server.port=3000'
volumes:
- ./.local-dev/grafana:/var/lib/grafana
- ./.local-dev/config/grafana.ini:/etc/grafana/grafana.ini:ro
Expand All @@ -337,13 +337,13 @@ services:

loki:
image: grafana/loki:3.1.0
command: "-config.file /etc/loki/loki.yaml"
command: '-config.file /etc/loki/loki.yaml'
restart: always
labels:
# for debug
- "traefik.enable=true"
- "traefik.http.routers.loki.rule=Host(`loki.local.trapti.tech`)"
- "traefik.http.services.loki.loadbalancer.server.port=3100"
- 'traefik.enable=true'
- 'traefik.http.routers.loki.rule=Host(`loki.local.trapti.tech`)'
- 'traefik.http.services.loki.loadbalancer.server.port=3100'
volumes:
- ./.local-dev/loki:/var/lib/loki
- ./.local-dev/config/loki.yaml:/etc/loki/loki.yaml:ro
Expand All @@ -352,7 +352,7 @@ services:

promtail:
image: grafana/promtail:3.1.0
command: "-config.file /etc/promtail/promtail.yaml"
command: '-config.file /etc/promtail/promtail.yaml'
restart: always
volumes:
- ./.local-dev/config/promtail.yaml:/etc/promtail/promtail.yaml
Expand Down Expand Up @@ -396,6 +396,8 @@ services:
- --provider.name=docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- .local-dev/config/sablier.yaml:/etc/sablier/sablier.yaml
- dashboard/sablier-theme:/etc/sablier/themes

traefik:
image: traefik:3.1
Expand All @@ -420,22 +422,22 @@ services:
- --experimental.plugins.sablier.modulename=github.com/sablierapp/sablier
- --experimental.plugins.sablier.version=v1.8.1
ports:
- "80:80"
- "443:443"
- "2201:2201"
- "8080:8080"
- "9100:9100"
- '80:80'
- '443:443'
- '2201:2201'
- '8080:8080'
- '9100:9100'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./.local-dev/traefik:/opt/neoshowcase/conf
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik_dashboard.rule=Host(`traefik.local.trapti.tech`)"
- "traefik.http.routers.traefik_dashboard.service=traefik_dashboard"
- "traefik.http.services.traefik_dashboard.loadbalancer.server.port=8080"
- "traefik.http.routers.traefik_metrics.rule=Host(`traefik.local.trapti.tech`) && PathPrefix(`/metrics`)"
- "traefik.http.routers.traefik_metrics.service=traefik_metrics"
- "traefik.http.services.traefik_metrics.loadbalancer.server.port=9100"
- 'traefik.enable=true'
- 'traefik.http.routers.traefik_dashboard.rule=Host(`traefik.local.trapti.tech`)'
- 'traefik.http.routers.traefik_dashboard.service=traefik_dashboard'
- 'traefik.http.services.traefik_dashboard.loadbalancer.server.port=8080'
- 'traefik.http.routers.traefik_metrics.rule=Host(`traefik.local.trapti.tech`) && PathPrefix(`/metrics`)'
- 'traefik.http.routers.traefik_metrics.service=traefik_metrics'
- 'traefik.http.services.traefik_metrics.loadbalancer.server.port=9100'
networks:
- default
- apps
Expand Down

0 comments on commit 42f8710

Please sign in to comment.