diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 7aa0ea1..7db6cd3 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -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: @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index efad59a..4f12254 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: @@ -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 diff --git a/Dockerfile b/Dockerfile index a2bc0a5..5a1dc52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM nginx:1.20.2 COPY nginx.conf /etc/nginx/nginx.conf.org -COPY health-check.conf /etc/nginx/ +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;"' EXPOSE 443 diff --git a/docker-compose.build.yml b/docker-compose.build.yml new file mode 100644 index 0000000..fa71619 --- /dev/null +++ b/docker-compose.build.yml @@ -0,0 +1,5 @@ +version: '3.8' +services: + nginx: + image: ghcr.io/opexdev/nginx:$TAG + build: . \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 6658dd9..13916c6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,15 @@ version: '3.8' services: nginx: - image: ghcr.io/opexdev/nginx:$TAG + image: ghcr.io/opexdev/nginx build: . environment: - EXPOSED_PORT=$EXPOSED_PORT + secrets: + - opex_dev_crt + - private_pem +secrets: + opex_dev_crt: + file: opex.dev.crt + private_pem: + file: private.pem \ No newline at end of file diff --git a/netnegar.conf b/netnegar.conf new file mode 100644 index 0000000..1e5864e --- /dev/null +++ b/netnegar.conf @@ -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; + } +} diff --git a/nginx.conf b/nginx.conf index 7ec6ac6..5e5b2d8 100644 --- a/nginx.conf +++ b/nginx.conf @@ -209,4 +209,6 @@ http { rewrite ^/binance/(.*)$ /$1 break; } } + + include /etc/nginx/netnegar.conf; }