deploy adaptation for vps
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# PostgreSQL
|
# PostgreSQL (shared VPS instance — create DB/user manually)
|
||||||
POSTGRES_DB=aips_db
|
POSTGRES_DB=aips_db
|
||||||
POSTGRES_USER=aips_user
|
POSTGRES_USER=aips_user
|
||||||
POSTGRES_PASSWORD=CHANGE_ME_strong_password_here
|
POSTGRES_PASSWORD=CHANGE_ME_strong_password_here
|
||||||
|
|||||||
@@ -1,20 +1,4 @@
|
|||||||
services:
|
services:
|
||||||
postgres:
|
|
||||||
image: postgres:18
|
|
||||||
container_name: aips-postgres
|
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
|
||||||
POSTGRES_DB: ${POSTGRES_DB}
|
|
||||||
POSTGRES_USER: ${POSTGRES_USER}
|
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
||||||
volumes:
|
|
||||||
- pgdata:/var/lib/postgresql/data
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
|
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
image: rabbitmq:3-management
|
image: rabbitmq:3-management
|
||||||
container_name: aips-rabbitmq
|
container_name: aips-rabbitmq
|
||||||
@@ -23,8 +7,6 @@ services:
|
|||||||
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
|
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
|
||||||
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
|
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
|
||||||
RABBITMQ_DEFAULT_VHOST: ${RABBITMQ_DEFAULT_VHOST}
|
RABBITMQ_DEFAULT_VHOST: ${RABBITMQ_DEFAULT_VHOST}
|
||||||
ports:
|
|
||||||
- "15672:15672"
|
|
||||||
volumes:
|
volumes:
|
||||||
- rabbitmqdata:/var/lib/rabbitmq
|
- rabbitmqdata:/var/lib/rabbitmq
|
||||||
healthcheck:
|
healthcheck:
|
||||||
@@ -50,9 +32,10 @@ services:
|
|||||||
JWT_KEY: "${JWT_KEY}"
|
JWT_KEY: "${JWT_KEY}"
|
||||||
JWT_EXPIRATION_MINUTES: "${JWT_EXPIRATION_MINUTES}"
|
JWT_EXPIRATION_MINUTES: "${JWT_EXPIRATION_MINUTES}"
|
||||||
JWT_REFRESH_TOKEN_EXPIRATION_DAYS: "${JWT_REFRESH_TOKEN_EXPIRATION_DAYS}"
|
JWT_REFRESH_TOKEN_EXPIRATION_DAYS: "${JWT_REFRESH_TOKEN_EXPIRATION_DAYS}"
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
- back_network
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
|
||||||
condition: service_healthy
|
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
@@ -73,9 +56,10 @@ services:
|
|||||||
JWT_KEY: "${JWT_KEY}"
|
JWT_KEY: "${JWT_KEY}"
|
||||||
JWT_EXPIRATION_MINUTES: "${JWT_EXPIRATION_MINUTES}"
|
JWT_EXPIRATION_MINUTES: "${JWT_EXPIRATION_MINUTES}"
|
||||||
JWT_REFRESH_TOKEN_EXPIRATION_DAYS: "${JWT_REFRESH_TOKEN_EXPIRATION_DAYS}"
|
JWT_REFRESH_TOKEN_EXPIRATION_DAYS: "${JWT_REFRESH_TOKEN_EXPIRATION_DAYS}"
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
- back_network
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
|
||||||
condition: service_healthy
|
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
@@ -92,9 +76,10 @@ services:
|
|||||||
JWT_ISSUER: "${JWT_ISSUER}"
|
JWT_ISSUER: "${JWT_ISSUER}"
|
||||||
JWT_AUDIENCE: "${JWT_AUDIENCE}"
|
JWT_AUDIENCE: "${JWT_AUDIENCE}"
|
||||||
JWT_KEY: "${JWT_KEY}"
|
JWT_KEY: "${JWT_KEY}"
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
- back_network
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
|
||||||
condition: service_healthy
|
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
@@ -105,11 +90,14 @@ services:
|
|||||||
container_name: aips-nginx
|
container_name: aips-nginx
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "8090:80"
|
||||||
depends_on:
|
depends_on:
|
||||||
- webapi
|
- webapi
|
||||||
- rt
|
- rt
|
||||||
|
|
||||||
|
networks:
|
||||||
|
back_network:
|
||||||
|
external: true
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
pgdata:
|
|
||||||
rabbitmqdata:
|
rabbitmqdata:
|
||||||
|
|||||||
45
deploy/nginx/aips-global.conf
Normal file
45
deploy/nginx/aips-global.conf
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name aips.stewki.com;
|
||||||
|
|
||||||
|
location /.well-known/acme-challenge/ {
|
||||||
|
root /var/www/certbot;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
server_name aips.stewki.com;
|
||||||
|
|
||||||
|
ssl_certificate /etc/letsencrypt/live/aips.stewki.com/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/aips.stewki.com/privkey.pem;
|
||||||
|
|
||||||
|
client_max_body_size 10M;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://host.docker.internal:8090;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /hubs/ {
|
||||||
|
proxy_pass http://host.docker.internal:8090;
|
||||||
|
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;
|
||||||
|
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
|
||||||
|
proxy_read_timeout 86400s;
|
||||||
|
proxy_send_timeout 86400s;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user