AUTH_CMD to USER_CMD, updated workflows, Makefile, and docker-compose for user service

This commit is contained in:
A'zamov Samandar
2025-04-19 19:24:18 +05:00
parent 098dce9fdb
commit bc24faeedd
126 changed files with 30 additions and 32 deletions

View File

@@ -1,2 +1,2 @@
AUTH_COMMAND=sh ./resources/scripts/entrypoint.sh
USER_COMMAND=sh ./resources/scripts/entrypoint.sh
JWT_KEY=key

View File

@@ -16,10 +16,10 @@ jobs:
- name: 📥 Secret orqali .env fayl yaratish
run: |
echo "${{ secrets.BASE_ENV_FILE }}" > .env
echo "${{ secrets.AUTH_ENV_FILE }}" > ./auth/.env
echo "${{ secrets.USER_ENV_FILE }}" > ./user/.env
- name: 🛠 Docker Compose bilan build & deploy
run: |
docker compose --profile auth --profile payment build
docker compose --profile user --profile payment build
docker compose down
docker compose --profile auth --profile payment up -d
docker compose --profile user --profile payment up -d

View File

@@ -1,12 +1,10 @@
up-auth:
docker compose --profile auth up -d
down-auth:
docker compose --profile auth down
up-user:
docker compose --profile user up -d
down-user:
docker compose --profile user down
up-payment:
docker compose --profile payment up -d
down-payment:
docker compose --profile payment down
down-all:
docker compose --profile payment --profile auth down
docker compose --profile payment --profile user down

View File

@@ -21,46 +21,46 @@ services:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
networks:
- lamenu
auth-nginx:
user-nginx:
labels:
- "traefik.enable=true"
- "traefik.http.routers.auth.rule=PathPrefix(`/auth`)"
- "traefik.http.routers.auth.entrypoints=web"
- "traefik.http.services.auth.loadbalancer.server.port=80"
- "traefik.http.middlewares.auth-strip-prefix.stripPrefix.prefixes=/auth"
- "traefik.http.routers.auth.middlewares=auth-strip-prefix"
- "traefik.http.routers.user.rule=PathPrefix(`/user`)"
- "traefik.http.routers.user.entrypoints=web"
- "traefik.http.services.user.loadbalancer.server.port=80"
- "traefik.http.middlewares.user-strip-prefix.stripPrefix.prefixes=/user"
- "traefik.http.routers.user.middlewares=user-strip-prefix"
networks:
- lamenu
volumes:
- ./auth/resources/layout/nginx.conf:/etc/nginx/nginx.conf
- ./auth/resources/:/usr/share/nginx/html/resources/
- ./user/resources/layout/nginx.conf:/etc/nginx/nginx.conf
- ./user/resources/:/usr/share/nginx/html/resources/
build:
context: ./auth
context: ./user
dockerfile: ./docker/Dockerfile.nginx
depends_on:
- auth
- user
profiles:
- auth
auth:
- user
user:
networks:
- lamenu
build:
context: ./auth
context: ./user
dockerfile: ./docker/Dockerfile.web
restart: always
command: ${AUTH_COMMAND:-sh ./resources/scripts/entrypoint.sh}
command: ${user_COMMAND:-sh ./resources/scripts/entrypoint.sh}
environment:
- PYTHONPYCACHEPREFIX=/var/cache/pycache
- JWT_KEY=${JWT_KEY}
volumes:
- ./auth:/code
- ./user:/code
- pycache:/var/cache/pycache
depends_on:
- auth-db
- user-db
- redis
profiles:
- auth
auth-db:
- user
user-db:
networks:
- lamenu
image: postgres:16
@@ -72,7 +72,7 @@ services:
volumes:
- pg_data:/var/lib/postgresql/data
profiles:
- auth
- user
payment:
labels:

View File

View File

@@ -29,14 +29,14 @@ http {
server_name _;
location / {
proxy_pass http://auth:8000;
proxy_pass http://user:8000;
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 https;
proxy_set_header Host $http_host;
}
location /ws/ {
proxy_pass http://auth:8000; # Uvicorn serveri ishga tushadigan port
proxy_pass http://user:8000; # Uvicorn serveri ishga tushadigan port
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';

Some files were not shown because too many files have changed in this diff Show More