AUTH_CMD to USER_CMD, updated workflows, Makefile, and docker-compose for user service
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
AUTH_COMMAND=sh ./resources/scripts/entrypoint.sh
|
||||
USER_COMMAND=sh ./resources/scripts/entrypoint.sh
|
||||
JWT_KEY=key
|
||||
6
.github/workflows/deploy.yml
vendored
6
.github/workflows/deploy.yml
vendored
@@ -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
|
||||
12
Makefile
12
Makefile
@@ -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
|
||||
@@ -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:
|
||||
|
||||
0
auth/.gitignore → user/.gitignore
vendored
0
auth/.gitignore → user/.gitignore
vendored
@@ -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
Reference in New Issue
Block a user