add profiles into dokcer-cmpse.ymal file

This commit is contained in:
2025-06-21 23:54:28 +03:00
parent fb90fc6d6e
commit 5e944fca12
4 changed files with 44 additions and 6 deletions
+5 -2
View File
@@ -1,8 +1,11 @@
build:
@docker compose build
run: stop
@docker compose up -d --remove-orphans
buildC:
@docker compose build --no-cache
run:
@docker compose --profile dev up -d --remove-orphans
stop:
@docker compose down
+4
View File
@@ -3,3 +3,7 @@
## before start your need to set .env file with your VARIABLES
## build and start with command: make
need to see conf for nginx and change link to keycloak
+27 -4
View File
@@ -3,6 +3,8 @@ services:
db:
image: postgres:16
container_name: db
profiles:
- prod
env_file:
- .env
ports:
@@ -20,6 +22,8 @@ services:
build:
context: ./api
dockerfile: Dockerfile
profiles:
- prod
env_file:
- .env
ports:
@@ -33,6 +37,8 @@ services:
migrator:
container_name: migrator
profiles:
- prod
build:
context: ./migrator
dockerfile: Dockerfile
@@ -47,6 +53,8 @@ services:
spa:
container_name: spa
profiles:
- prod
build:
context: ./spa
dockerfile: Dockerfile
@@ -57,6 +65,9 @@ services:
build:
context: ./nginx
dockerfile: Dockerfile
profiles:
- prod
- dev
env_file: .env
container_name: nginx
restart: unless-stopped
@@ -69,6 +80,7 @@ services:
- ./spa/app:/usr/share/nginx/html
networks:
- web-network
- internal
depends_on:
- certbot
@@ -77,6 +89,9 @@ services:
context: ./certbot
dockerfile: Dockerfile
container_name: certbot
profiles:
- prod
- dev
volumes:
- certbot_data:/etc/letsencrypt
- certbot_www:/var/www/certbot
@@ -90,23 +105,31 @@ services:
keycloak:
image: quay.io/keycloak/keycloak:latest
container_name: keycloak
ports:
- "8080:8080"
profiles:
- prod
- dev
environment:
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
DB_VENDOR: postgres
DB_ADDR: postgres # Имя сервиса PostgreSQL
DB_ADDR: kk_db # Имя сервиса PostgreSQL
DB_DATABASE: keycloak
DB_USER: postgres
DB_PASSWORD: postgres
depends_on:
- postgres
- kk_db
networks:
- internal
postgres:
image: postgres:latest
kk_db:
image: postgres:16
container_name: kk_db
profiles:
- prod
- dev
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: postgres
+8
View File
@@ -22,4 +22,12 @@ server {
root /usr/share/nginx/html;
index index.html;
}
location /auth {
proxy_pass http://keycloak:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}