Refactor dockerfiles for clarity

This commit is contained in:
Alex Holliday committed 2024-10-01 15:52:46 +08:00
1 parent 3a31387d00
commit 2499925423
20 files changed
+126 -40

No files matched your search

+4 -4
View File
@@ -1,19 +1,19 @@
FROM node:20-alpine as build
FROM node:20-alpine AS build
WORKDIR /app
COPY ./Client/package*.json ./
COPY ../../Client/package*.json ./
RUN npm install
COPY ./Client .
COPY ../../Client .
RUN npm run build
FROM nginx:1.27.1-alpine
COPY ./Docker/nginx/conf.d/dist_default.conf /etc/nginx/conf.d/default.conf
COPY ./Docker/dist/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]
+35
View File
@@ -0,0 +1,35 @@
server {
listen 80;
listen [::]:80;
server_name uptime-demo.bluewavelabs.ca;
server_tokens off;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://server:5000/api/;
proxy_http_version 1.1;
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 /api-docs/ {
proxy_pass http://server:5000/api-docs/;
proxy_http_version 1.1;
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;
}
}
+2 -2
View File
@@ -2,11 +2,11 @@ FROM node:20-alpine
WORKDIR /app
COPY ./Server/package*.json ./
COPY ../../Server/package*.json ./
RUN npm install
COPY ./Server/ ./
COPY ../../Server/ ./
EXPOSE 5000