feat(proxy): add proxy service for google oauth connection
This commit is contained in:
@@ -25,9 +25,9 @@ RUN apt-get update \
|
|||||||
|
|
||||||
COPY requirements/ /app/requirements/
|
COPY requirements/ /app/requirements/
|
||||||
|
|
||||||
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
|
RUN pip install --no-cache-dir --upgrade pip setuptools wheel -i https://package-mirror.liara.ir/repository/pypi/simple \
|
||||||
&& pip install --no-cache-dir -r requirements/base.txt \
|
&& pip install --no-cache-dir -r requirements/base.txt -i https://package-mirror.liara.ir/repository/pypi/simple \
|
||||||
&& pip install --no-cache-dir -r requirements/prod.txt
|
&& pip install --no-cache-dir -r requirements/prod.txt -i https://package-mirror.liara.ir/repository/pypi/simple
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +1,47 @@
|
|||||||
services:
|
services:
|
||||||
db:
|
proxy:
|
||||||
image: postgres:18-alpine
|
build:
|
||||||
restart: always
|
context: ../proxy
|
||||||
env_file:
|
dockerfile: Dockerfile
|
||||||
- ./backend/qlockify-backend-deployment/.env
|
restart: unless-stopped
|
||||||
volumes:
|
expose:
|
||||||
- postgres_data:/var/lib/postgresql
|
- "8085"
|
||||||
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
|
volumes:
|
||||||
command: postgres
|
- ../proxy/config.json:/app/config.json:ro
|
||||||
healthcheck:
|
- ../proxy/ca:/app/ca
|
||||||
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
environment:
|
||||||
interval: 10s
|
PYTHONUNBUFFERED: "1"
|
||||||
timeout: 5s
|
PROXY_HOST: "0.0.0.0"
|
||||||
retries: 5
|
PROXY_PORT: "8085"
|
||||||
ports:
|
|
||||||
- "127.0.0.1:5432:5432" # Bound to localhost for security (as in old project)
|
db:
|
||||||
|
image: postgres:18-alpine
|
||||||
redis:
|
restart: always
|
||||||
image: redis:7-alpine
|
env_file:
|
||||||
restart: always
|
- ./backend/qlockify-backend-deployment/.env
|
||||||
ports:
|
volumes:
|
||||||
- "127.0.0.1:6379:6379"
|
- postgres_data:/var/lib/postgresql
|
||||||
|
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
|
command: postgres
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:5432:5432" # Bound to localhost for security (as in old project)
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:6379:6379"
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ./backend/qlockify-backend-deployment
|
context: ./backend/qlockify-backend-deployment
|
||||||
dockerfile: ../Dockerfile
|
dockerfile: ../Dockerfile
|
||||||
restart: always
|
restart: always
|
||||||
env_file:
|
env_file:
|
||||||
- ./backend/qlockify-backend-deployment/.env
|
- ./backend/qlockify-backend-deployment/.env
|
||||||
volumes:
|
volumes:
|
||||||
@@ -42,27 +57,36 @@ services:
|
|||||||
--threads 8
|
--threads 8
|
||||||
--timeout 120
|
--timeout 120
|
||||||
--keep-alive 75"
|
--keep-alive 75"
|
||||||
expose:
|
expose:
|
||||||
- "8000"
|
- "8000"
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
redis:
|
redis:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
|
proxy:
|
||||||
|
condition: service_started
|
||||||
|
environment:
|
||||||
|
HTTP_PROXY: "http://proxy:8085"
|
||||||
|
HTTPS_PROXY: "http://proxy:8085"
|
||||||
|
http_proxy: "http://proxy:8085"
|
||||||
|
https_proxy: "http://proxy:8085"
|
||||||
|
NO_PROXY: "localhost,127.0.0.1,db,redis,proxy"
|
||||||
|
no_proxy: "localhost,127.0.0.1,db,redis,proxy"
|
||||||
|
|
||||||
celery:
|
celery:
|
||||||
build:
|
build:
|
||||||
context: ./backend/qlockify-backend-deployment
|
context: ./backend/qlockify-backend-deployment
|
||||||
dockerfile: ../Dockerfile
|
dockerfile: ../Dockerfile
|
||||||
restart: always
|
restart: always
|
||||||
env_file:
|
env_file:
|
||||||
- ./backend/qlockify-backend-deployment/.env
|
- ./backend/qlockify-backend-deployment/.env
|
||||||
volumes:
|
volumes:
|
||||||
- media_data:/app/media
|
- media_data:/app/media
|
||||||
command: celery -A config worker -l INFO
|
command: celery -A config worker -l INFO
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
redis:
|
redis:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
backend:
|
backend:
|
||||||
@@ -89,13 +113,13 @@ services:
|
|||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
context: ./frontend/qlockify-frontend-deployment
|
context: ./frontend/qlockify-frontend-deployment
|
||||||
dockerfile: ../Dockerfile
|
dockerfile: ../Dockerfile
|
||||||
restart: always
|
restart: always
|
||||||
env_file:
|
env_file:
|
||||||
- ./frontend/qlockify-frontend-deployment/.env
|
- ./frontend/qlockify-frontend-deployment/.env
|
||||||
expose:
|
expose:
|
||||||
- "80"
|
- "80"
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:alpine
|
image: nginx:alpine
|
||||||
restart: always
|
restart: always
|
||||||
@@ -108,10 +132,10 @@ services:
|
|||||||
- ./nginx/.htpasswd:/etc/nginx/.htpasswd:ro
|
- ./nginx/.htpasswd:/etc/nginx/.htpasswd:ro
|
||||||
- static_data:/usr/share/nginx/html/static:ro
|
- static_data:/usr/share/nginx/html/static:ro
|
||||||
- media_data:/usr/share/nginx/html/media:ro
|
- media_data:/usr/share/nginx/html/media:ro
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
- frontend
|
- frontend
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
static_data:
|
static_data:
|
||||||
|
|||||||
Reference in New Issue
Block a user