Skip to content

Commit

Permalink
fix publishing docker images
Browse files Browse the repository at this point in the history
Signed-off-by: simvalery <[email protected]>
  • Loading branch information
simvalery committed Jul 19, 2022
1 parent df8a4c1 commit 72eba2a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
18 changes: 18 additions & 0 deletions web-proxy/Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:16 as frontendBuilder
WORKDIR /usr/local/interfaces
COPY ./interfaces/package*.json /usr/local/interfaces/
COPY ./interfaces/tsconfig.json /usr/local/interfaces/
RUN npm install
ADD ./interfaces/src/ /usr/local/interfaces/src/.
RUN npm run build
WORKDIR /usr/local/frontend
COPY ./frontend/. /usr/local/frontend
RUN npm install
RUN npm run build

FROM nginx:latest
ENV PLATFORM="docker"
COPY ./web-proxy/configs/default.conf /etc/nginx/conf.d/image.conf
COPY --from=frontendBuilder /usr/local/frontend/dist/guardian /usr/share/nginx/html

EXPOSE 80
35 changes: 35 additions & 0 deletions web-proxy/configs/image.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
server {
listen 80;
listen [::]:80;
server_name localhost;

location /ws/ {
proxy_pass http://$ENV{"GATEWAY_HOST"}:$ENV{"GATEWAY_PORT"};
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 600s;
}

location /api/v1/ {
proxy_pass http://$ENV{"GATEWAY_HOST"}:$ENV{"GATEWAY_PORT"}/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Surrogate-Control no-store;
proxy_set_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
proxy_set_header Pragma no-cache;
proxy_set_header Expires 0;
proxy_redirect off;
proxy_read_timeout 600s;
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
}

location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
}

0 comments on commit 72eba2a

Please sign in to comment.