157 lines
2.9 KiB
YAML
157 lines
2.9 KiB
YAML
services:
|
|
|
|
db:
|
|
image: postgres:16
|
|
container_name: db
|
|
profiles:
|
|
- prod
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "${PGPORT}:${PGPORT}"
|
|
volumes:
|
|
- postgres-db:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_USER=${PGUSER}
|
|
- POSTGRES_PASSWORD=${PGPASSWORD}
|
|
- POSTGRES_DB=${PGDATABASE}
|
|
restart: unless-stopped
|
|
|
|
api:
|
|
container_name: api
|
|
build:
|
|
context: ./api
|
|
dockerfile: Dockerfile
|
|
profiles:
|
|
- prod
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "${SERVER_PORT}:${SERVER_PORT}"
|
|
volumes:
|
|
- api:/usr/src/app
|
|
depends_on:
|
|
- db
|
|
command: ./bin/api
|
|
restart: unless-stopped
|
|
|
|
migrator:
|
|
container_name: migrator
|
|
profiles:
|
|
- prod
|
|
build:
|
|
context: ./migrator
|
|
dockerfile: Dockerfile
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
- api
|
|
- db
|
|
volumes:
|
|
- goose:/migrations
|
|
command: goose up
|
|
|
|
spa:
|
|
container_name: spa
|
|
profiles:
|
|
- prod
|
|
build:
|
|
context: ./spa
|
|
dockerfile: Dockerfile
|
|
env_file:
|
|
- .env
|
|
|
|
nginx:
|
|
build:
|
|
context: ./nginx
|
|
dockerfile: Dockerfile
|
|
profiles:
|
|
- prod
|
|
- dev
|
|
env_file: .env
|
|
container_name: nginx
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- certbot_data:/etc/letsencrypt
|
|
- certbot_www:/var/www/certbot
|
|
- ./spa/app:/usr/share/nginx/html
|
|
networks:
|
|
- web-network
|
|
- internal
|
|
depends_on:
|
|
- certbot
|
|
|
|
certbot:
|
|
build:
|
|
context: ./certbot
|
|
dockerfile: Dockerfile
|
|
container_name: certbot
|
|
profiles:
|
|
- prod
|
|
- dev
|
|
volumes:
|
|
- certbot_data:/etc/letsencrypt
|
|
- certbot_www:/var/www/certbot
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- EMAIL=valitovgaziz@yandex.ru
|
|
- DOMAINS=yalarba.ru
|
|
- STAGING=0
|
|
restart: unless-stopped
|
|
|
|
keycloak:
|
|
image: quay.io/keycloak/keycloak:latest
|
|
container_name: keycloak
|
|
ports:
|
|
- "8080:8080"
|
|
profiles:
|
|
- prod
|
|
- dev
|
|
environment:
|
|
KEYCLOAK_ADMIN: admin
|
|
KEYCLOAK_ADMIN_PASSWORD: admin
|
|
KC_HOSTNAME: localhost
|
|
DB_VENDOR: postgres
|
|
DB_ADDR: kk_db # Имя сервиса PostgreSQL
|
|
DB_DATABASE: keycloak
|
|
DB_USER: postgres
|
|
DB_PASSWORD: postgres
|
|
KC_HTTP_ENABLED: "true"
|
|
command: start-dev
|
|
depends_on:
|
|
- kk_db
|
|
networks:
|
|
- internal
|
|
|
|
kk_db:
|
|
image: postgres:16
|
|
container_name: kk_db
|
|
profiles:
|
|
- prod
|
|
- dev
|
|
environment:
|
|
POSTGRES_DB: keycloak
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
volumes:
|
|
- keycloak-postgres:/var/lib/postgresql/data
|
|
networks:
|
|
- internal
|
|
|
|
volumes:
|
|
api:
|
|
postgres-db:
|
|
goose:
|
|
certbot_data:
|
|
certbot_www:
|
|
keycloak-postgres:
|
|
|
|
networks:
|
|
web-network:
|
|
driver: bridge
|
|
internal:
|