From e222bef5775a5cef54edf7a28b160c0dd9c37f64 Mon Sep 17 00:00:00 2001 From: Ammar Qaffaf Date: Mon, 11 Mar 2024 06:24:52 -0400 Subject: [PATCH] move to rest --- .github/workflows/dev_syncrow(dev).yml | 7 ++--- Dockerfile | 6 +--- nginx.conf | 38 -------------------------- src/main.ts | 2 +- 4 files changed, 4 insertions(+), 49 deletions(-) delete mode 100644 nginx.conf diff --git a/.github/workflows/dev_syncrow(dev).yml b/.github/workflows/dev_syncrow(dev).yml index 8373a4f..d38510c 100644 --- a/.github/workflows/dev_syncrow(dev).yml +++ b/.github/workflows/dev_syncrow(dev).yml @@ -1,4 +1,4 @@ -name: Auth and Backend using Docker to Azure App Service +name: Backend deployment to Azure App Service on: push: @@ -30,9 +30,6 @@ jobs: npm install npm run build - - name: List build output - run: ls -R dist/apps/ - - name: Log in to Azure uses: azure/login@v1 with: @@ -42,7 +39,7 @@ jobs: run: az acr login --name ${{ env.ACR_REGISTRY }} - name: List build output - run: ls -R dist/apps/ + run: ls -R dist/ - name: Build and push Docker image run: | diff --git a/Dockerfile b/Dockerfile index 8783b8c..8bd0930 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,5 @@ FROM node:20-alpine -RUN apk add --no-cache nginx - -COPY nginx.conf /etc/nginx/nginx.conf - WORKDIR /app COPY package*.json ./ @@ -14,6 +10,6 @@ COPY . . RUN npm run build -EXPOSE 8080 +EXPOSE 4000 CMD ["sh", "-c", "nginx -g 'daemon off;' & npm run start:all"] diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index 0ccf92e..0000000 --- a/nginx.conf +++ /dev/null @@ -1,38 +0,0 @@ -worker_processes 1; - -events { - worker_connections 1024; -} - -http { - include mime.types; - default_type application/octet-stream; - sendfile on; - keepalive_timeout 65; - - server { - listen 8080; - - location /auth { - proxy_pass http://localhost:4001; - 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 / { - proxy_pass http://localhost:4000; - 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; - } - - # error pages - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } - } -} diff --git a/src/main.ts b/src/main.ts index ed08082..dc73a00 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,7 +33,7 @@ async function bootstrap() { app.useGlobalPipes(new ValidationPipe()); - await app.listen(4001); + await app.listen(4000); } console.log('Starting auth at port 4001...'); bootstrap();