gold eggs backend
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
This commit is contained in:
0
deployments/django-project/Dockerfile
Executable file
0
deployments/django-project/Dockerfile
Executable file
73
deployments/docker-compose.yml
Executable file
73
deployments/docker-compose.yml
Executable file
@@ -0,0 +1,73 @@
|
||||
version: "3.11"
|
||||
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
restart: always
|
||||
command: ${COMMAND:-python3 manage.py runserver 0.0.0.0:8000}
|
||||
volumes:
|
||||
- .:/code
|
||||
ports:
|
||||
- "8001:8000"
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
db:
|
||||
image: postgres:13
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_DB: django
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: 2309
|
||||
volumes:
|
||||
- pg_data:/var/lib/postgresql/data
|
||||
redis:
|
||||
restart: always
|
||||
image: "redis"
|
||||
ngrok:
|
||||
image: ngrok/ngrok:latest
|
||||
ports:
|
||||
- ${NGROK_ADMIN_PORT}:4040
|
||||
environment:
|
||||
NGROK_AUTHTOKEN: ${NGROK_AUTHTOKEN}
|
||||
command: http http://web:8000 --domain=${NGROK_DOMAIN}
|
||||
nginx:
|
||||
build: ./nginx
|
||||
ports:
|
||||
- '81:80'
|
||||
depends_on:
|
||||
- web
|
||||
|
||||
# vite:
|
||||
# build:
|
||||
# context: .
|
||||
# dockerfile: ViteDockerfile
|
||||
# ports:
|
||||
# - ${VITE_PORT}:5173
|
||||
# volumes:
|
||||
# - .:/code
|
||||
# - /code/node_modules
|
||||
|
||||
celery:
|
||||
build: .
|
||||
command: celery -A config worker --loglevel=info
|
||||
restart: always
|
||||
volumes:
|
||||
- .:/code
|
||||
depends_on:
|
||||
- web
|
||||
- redis
|
||||
|
||||
# celery-beat:
|
||||
# build: .
|
||||
# command: celery -A config beat --loglevel=info
|
||||
# restart: always
|
||||
# volumes:
|
||||
# - .:/code
|
||||
# depends_on:
|
||||
# - web
|
||||
# - redis
|
||||
|
||||
volumes:
|
||||
pg_data:
|
||||
|
||||
0
deployments/nginx/Dockerfile
Executable file
0
deployments/nginx/Dockerfile
Executable file
22
deployments/nginx/default.conf
Executable file
22
deployments/nginx/default.conf
Executable file
@@ -0,0 +1,22 @@
|
||||
upstream django {
|
||||
server web:8000;
|
||||
}
|
||||
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name domain.com;
|
||||
root /code/;
|
||||
access_log /var/log/nginx/django.access.log;
|
||||
error_log /var/log/nginx/django.error.log;
|
||||
client_max_body_size 1024M;
|
||||
try_files $uri @django;
|
||||
|
||||
location @django {
|
||||
proxy_pass http://django;
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
}
|
||||
29
deployments/nginx/microservice.conf
Normal file
29
deployments/nginx/microservice.conf
Normal file
@@ -0,0 +1,29 @@
|
||||
server {
|
||||
|
||||
listen 80;
|
||||
charset utf-8;
|
||||
|
||||
location /api/v1/products {
|
||||
rewrite /api/v1/products(.*) /products$1 break;
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_pass http://products_web:8001;
|
||||
}
|
||||
|
||||
|
||||
location /api/v1/emails {
|
||||
rewrite /api/v1/emails(.*) /emails$1 break;
|
||||
proxy_pass http://emails_web:8002;
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
|
||||
location /api/v1/orders {
|
||||
rewrite /api/v1/orders(.*) /orders$1 break;
|
||||
proxy_pass http://orders_web:8003;
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user