You've already forked Php-Template
feat: update Docker configuration for SSL support and improve service registration (#26)
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 1m34s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 1m44s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 1m49s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 1m41s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 1m47s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 1m30s
🏗️✨ Build Workflow / 🖥️ 🔨 Build (push) Successful in 19m32s
🏗️✨ Build Workflow / 🖥️ 🔨 Build Migrations (push) Successful in 1m39s
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 1m34s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 1m44s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 1m49s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 1m41s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 1m47s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 1m30s
🏗️✨ Build Workflow / 🖥️ 🔨 Build (push) Successful in 19m32s
🏗️✨ Build Workflow / 🖥️ 🔨 Build Migrations (push) Successful in 1m39s
Reviewed-on: #26 Co-authored-by: Ron Rise <ron@siteworxpro.com> Co-committed-by: Ron Rise <ron@siteworxpro.com>
This commit was merged in pull request #26.
This commit is contained in:
190
.dev/docker-compose.yml
Normal file
190
.dev/docker-compose.yml
Normal file
@@ -0,0 +1,190 @@
|
||||
volumes:
|
||||
redisdata: {}
|
||||
pgdata: {}
|
||||
|
||||
services:
|
||||
|
||||
traefik:
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.traefik.entrypoints=web-secure"
|
||||
- "traefik.http.routers.traefik.rule=Host(`127.0.0.1`) && (PathPrefix(`/dashboard`) || PathPrefix(`/api`))"
|
||||
- "traefik.http.routers.traefik.tls=true"
|
||||
- "traefik.http.routers.traefik.service=api@internal"
|
||||
image: traefik:latest
|
||||
container_name: traefik
|
||||
healthcheck:
|
||||
test: ["CMD", "traefik", "healthcheck", "--ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
- "9001:9001"
|
||||
volumes:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock"
|
||||
- "./ssl:/etc/ssl"
|
||||
restart: always
|
||||
command:
|
||||
- "--providers.docker=true"
|
||||
- "--api.insecure=true"
|
||||
- "--ping"
|
||||
- "--providers.file.filename=/etc/ssl/traefik.yml"
|
||||
- "--providers.docker.exposedByDefault=false"
|
||||
- "--entrypoints.web.address=:80"
|
||||
- "--entrypoints.web-secure.address=:443"
|
||||
- "--entrypoints.grpc.address=:9001"
|
||||
- "--accesslog=true"
|
||||
- "--entrypoints.web.http.redirections.entryPoint.to=web-secure"
|
||||
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
|
||||
- "--entrypoints.web.http.redirections.entrypoint.permanent=true"
|
||||
|
||||
composer-runtime:
|
||||
volumes:
|
||||
- ..:/app
|
||||
image: siteworxpro/composer
|
||||
entrypoint: "/bin/sh -c 'while true; do sleep 30; done;'"
|
||||
environment:
|
||||
PHP_IDE_CONFIG: serverName=localhost
|
||||
|
||||
swagger-ui:
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.swagger-ui.entrypoints=web-secure"
|
||||
- "traefik.http.routers.swagger-ui.rule=Host(`localhost`) && PathPrefix(`/docs`)"
|
||||
- "traefik.http.routers.swagger-ui.tls=true"
|
||||
- "traefik.http.routers.swagger-ui.service=swagger-ui"
|
||||
- "traefik.http.services.swagger-ui.loadbalancer.server.port=8080"
|
||||
image: swaggerapi/swagger-ui:latest
|
||||
container_name: swagger-ui
|
||||
environment:
|
||||
BASE_URL: /docs
|
||||
URL: /.well-known/swagger.yaml
|
||||
|
||||
migration-container:
|
||||
volumes:
|
||||
- ../db/migrations:/app/db/migrations
|
||||
- ../bin:/app/bin
|
||||
image: siteworxpro/migrate:v4.18.3
|
||||
working_dir: /app
|
||||
# entrypoint: "/bin/sh -c 'while true; do sleep 30; done;'"
|
||||
entrypoint: /bin/sh -c '/app/bin/migrate.sh'
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DB_USERNAME: ${DB_USERNAME:-siteworxpro}
|
||||
DB_PASSWORD: ${DB_PASSWORD:-password}
|
||||
DB_DATABASE: ${DB_DATABASE:-siteworxpro}
|
||||
DB_HOST: ${DB_HOST-postgres}
|
||||
DB_PORT: ${DB_PORT-5432}
|
||||
|
||||
dev-runtime:
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.api.entrypoints=web-secure"
|
||||
- "traefik.http.routers.api.rule=Host(`localhost`) || Host(`127.0.0.1`)"
|
||||
- "traefik.http.routers.api.tls=true"
|
||||
- "traefik.http.routers.api.service=api"
|
||||
- "traefik.http.services.api.loadbalancer.healthcheck.path=/healthz"
|
||||
- "traefik.http.services.api.loadbalancer.healthcheck.interval=5s"
|
||||
- "traefik.http.services.api.loadbalancer.healthcheck.timeout=60s"
|
||||
- "traefik.tcp.services.api.loadbalancer.server.port=9001"
|
||||
- "traefik.http.services.api.loadbalancer.server.port=9501"
|
||||
- "traefik.tcp.routers.grpc.entrypoints=grpc"
|
||||
- "traefik.tcp.routers.grpc.rule=HostSNI(`localhost`) || HostSNI(`127.0.0.1`)"
|
||||
- "traefik.tcp.routers.grpc.tls=true"
|
||||
- "traefik.tcp.routers.grpc.service=api"
|
||||
container_name: dev-runtime
|
||||
volumes:
|
||||
- ..:/app
|
||||
build:
|
||||
args:
|
||||
KAFKA_ENABLED: "1"
|
||||
context: ..
|
||||
dockerfile: Dockerfile
|
||||
entrypoint: "/bin/sh -c 'while true; do sleep 30; done;'"
|
||||
depends_on:
|
||||
migration-container:
|
||||
condition: service_completed_successfully
|
||||
traefik:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
JWT_ISSUER: https://auth.siteworxpro.com/application/o/postman/
|
||||
JWT_AUDIENCE: 1RWyqJFlyA4hmsDzq6kSxs0LXvk7UgEAfgmBCpQ9
|
||||
JWT_SIGNING_KEY: https://auth.siteworxpro.com/application/o/postman/.well-known/openid-configuration
|
||||
QUEUE_BROKER: redis
|
||||
PHP_IDE_CONFIG: serverName=localhost
|
||||
WORKERS: 1
|
||||
GRPC_WORKERS: 1
|
||||
DEBUG: 1
|
||||
REDIS_HOST: redis
|
||||
DB_HOST: postgres
|
||||
DEV_MODE: 1
|
||||
|
||||
## Kafka and Zookeeper for local development
|
||||
kafka-ui:
|
||||
image: kafbat/kafka-ui:latest # Or kafbat/kafka-ui:latest for newer Kafka
|
||||
container_name: kafka-ui
|
||||
ports:
|
||||
- "8080:8080" # Expose the UI port
|
||||
environment:
|
||||
KAFKA_CLUSTERS_0_NAME: local-kafka-cluster
|
||||
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
|
||||
depends_on:
|
||||
kafka:
|
||||
condition: service_started
|
||||
zookeeper:
|
||||
condition: service_started
|
||||
zookeeper:
|
||||
image: ubuntu/zookeeper:latest
|
||||
environment:
|
||||
ALLOW_ANONYMOUS_LOGIN: "yes"
|
||||
ports:
|
||||
- "2181:2181"
|
||||
kafka:
|
||||
image: ubuntu/kafka:latest
|
||||
environment:
|
||||
KAFKA_BROKER_ID: 1
|
||||
KAFKA_LISTENERS: PLAINTEXT://kafka:9092
|
||||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
|
||||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
||||
ALLOW_PLAINTEXT_LISTENER: "yes"
|
||||
ports:
|
||||
- "9092:9092"
|
||||
depends_on:
|
||||
zookeeper:
|
||||
condition: service_started
|
||||
|
||||
redis:
|
||||
image: redis:latest
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redisdata:/data
|
||||
|
||||
postgres:
|
||||
image: postgres:18
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME:-siteworxpro}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
environment:
|
||||
POSTGRES_USER: ${DB_USERNAME:-siteworxpro}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
|
||||
POSTGRES_DB: ${DB_DATABASE:-siteworxpro}
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql
|
||||
Reference in New Issue
Block a user