Skip to content

Instantly share code, notes, and snippets.

@siteslave
Created November 26, 2021 07:30
Show Gist options
  • Save siteslave/bd8bbc316f7fd619eafa4d1cf28a487c to your computer and use it in GitHub Desktop.
Save siteslave/bd8bbc316f7fd619eafa4d1cf28a487c to your computer and use it in GitHub Desktop.
version: "3"
services:
api:
image: "registry.gitlab.com/moph-training/surat/api:latest"
container_name: "api"
ports:
- 3000:3000
volumes:
- ./config/env:/home/api/config/env
restart: always
web:
image: "registry.gitlab.com/moph-training/surat/web:latest"
container_name: "web"
ports:
- 3001:80
restart: always
@siteslave
Copy link
Author

config/env

DB_HOST=localhost
DB_PORT=3306
DB_NAME=vaccine
DB_USER=root
DB_PASSWORD=xxxxxxxx

SECRET_KEY=xxxxxxxxxxxxxxxxxx
PORT=3000

@siteslave
Copy link
Author

nginx.conf

 location /covid/ {
    proxy_pass http://localhost:3001;
    proxy_set_header Host $http_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_set_header X-NginX-Proxy true;
    proxy_redirect off;
    include /etc/nginx/mime.types;
    rewrite ^/covid/(.*)$ /$1 break;
  }

  location /api/covid/ {
    limit_req zone=apilimit burst=5;
    proxy_pass http://localhost:3000;
    rewrite ^/api/covid/(.*)$ /$1 break;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment