Skip to content
Merged
4 changes: 2 additions & 2 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Build Docker images
env:
TAG: dev
run: docker-compose build
run: docker-compose -f docker-compose.build.yml build
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
Expand All @@ -25,4 +25,4 @@ jobs:
- name: Push images to GitHub Container Registry
env:
TAG: dev
run: docker-compose push
run: docker-compose -f docker-compose.build.yml push
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Build Docker images
env:
TAG: latest
run: docker-compose build
run: docker-compose -f docker-compose.build.yml build
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
Expand All @@ -25,4 +25,4 @@ jobs:
- name: Push images to GitHub Container Registry
env:
TAG: latest
run: docker-compose push
run: docker-compose -f docker-compose.build.yml push
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
FROM nginx:1.20.2
COPY nginx.conf /etc/nginx/nginx.conf.org
COPY health-check.conf netnegar.conf /etc/nginx/
ENV EXPOSED_PORT 443
ENTRYPOINT sh -c 'envsubst \$EXPOSED_PORT < /etc/nginx/nginx.conf.org | tee /etc/nginx/nginx.conf && nginx -g "daemon off;"'
ENV SERVER_NAME_DASHBOARD dashbrd-demo.opex.dev
ENV SERVER_NAME_ADMIN_PANEL adm-demo.opex.dev
ENV SERVER_NAME_WEB_APP demo.opex.dev
ENV SERVER_NAME_AUTH auth-demo.opex.dev
ENV SERVER_NAME_API api.opex.dev
ENTRYPOINT sh -c 'envsubst \
\$EXPOSED_PORT,\$SERVER_NAME_DASHBOARD,\$SERVER_NAME_ADMIN_PANEL,\$SERVER_NAME_WEB_APP,\$SERVER_NAME_AUTH,\$SERVER_NAME_API \
< /etc/nginx/nginx.conf.org \
| tee /etc/nginx/nginx.conf \
&& nginx -g "daemon off;"'
EXPOSE 443
5 changes: 5 additions & 0 deletions docker-compose.build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: '3.8'
services:
nginx:
image: ghcr.io/opexdev/nginx:$TAG
build: .
15 changes: 14 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
version: '3.8'
services:
nginx:
image: ghcr.io/opexdev/nginx:$TAG
image: ghcr.io/opexdev/nginx
build: .
environment:
- EXPOSED_PORT=$EXPOSED_PORT
- SERVER_NAME_DASHBOARD=$SERVER_NAME_DASHBOARD
- SERVER_NAME_ADMIN_PANEL=$SERVER_NAME_ADMIN_PANEL
- SERVER_NAME_WEB_APP=$SERVER_NAME_WEB_APP
- SERVER_NAME_AUTH=$SERVER_NAME_AUTH
- SERVER_NAME_API=$SERVER_NAME_API
secrets:
- opex_dev_crt
- private_pem
secrets:
opex_dev_crt:
file: opex.dev.crt
private_pem:
file: private.pem
6 changes: 6 additions & 0 deletions health-check.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
location ~ ^\/(auth|wallet|accountant|bc-gateway|gateway|eventlog|matching-engine|storage|referral|stream|ipg|admin|api|captcha|bitcoin-scanner|ethereum-scanner|bsc-scanner|tron-scanner|scanner-scheduler)\/actuator\/health$ {
rewrite ^\/(.*)\/actuator\/health$ $1;
set $backend http://$uri:8080;
proxy_pass $backend;
rewrite .* /actuator/health break;
}
11 changes: 11 additions & 0 deletions netnegar.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
server {
listen 443 ssl;
listen [::]:443 ssl;

server_name status.opex.dev;

location / {
set $backend http://public.netnegar.io;
proxy_pass $backend;
}
}
14 changes: 9 additions & 5 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ http {
listen 443 ssl;
listen [::]:443 ssl;

server_name dashbrd-demo.opex.dev;
server_name $SERVER_NAME_DASHBOARD;

location / {
set $backend http://superset:8088;
Expand All @@ -53,7 +53,7 @@ http {
listen 443 ssl;
listen [::]:443 ssl;

server_name adm-demo.opex.dev;
server_name $SERVER_NAME_ADMIN_PANEL;

location ~* \.(.*)$ {
set $backend http://admin-panel;
Expand All @@ -71,7 +71,7 @@ http {
listen 443 ssl;
listen [::]:443 ssl;

server_name demo.opex.dev;
server_name $SERVER_NAME_WEB_APP;

location ~* \.(.*)$ {
set $backend http://web-app;
Expand All @@ -89,7 +89,7 @@ http {
listen 443 ssl;
listen [::]:443 ssl;

server_name auth-demo.opex.dev;
server_name $SERVER_NAME_AUTH;

location / {
set $backend http://auth:8080;
Expand All @@ -102,14 +102,16 @@ http {
listen 443 ssl;
listen [::]:443 ssl;

server_name api.opex.dev;
server_name $SERVER_NAME_API;

limit_req zone=default burst=5 nodelay;

if ($request_method = 'OPTIONS') {
return 204;
}

include /etc/nginx/health-check.conf;

location /wallet/transfer {
return 403;
}
Expand Down Expand Up @@ -207,4 +209,6 @@ http {
rewrite ^/binance/(.*)$ /$1 break;
}
}

include /etc/nginx/netnegar.conf;
}