Dockerfile and nginx conf file for serving static built files

This commit is contained in:
2023-07-29 13:43:26 +02:00
parent d47e537b1d
commit b16a1f5f1c
2 changed files with 41 additions and 0 deletions

19
Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
FROM node:current-alpine3.17 as builder
WORKDIR /app
COPY package*.json .
COPY *config* .
COPY .env .
COPY src/ src
COPY static/ static
RUN npm install
RUN npm run build
FROM nginx:alpine
WORKDIR /app
COPY --from=builder /app/build .
COPY ./nginx.conf /etc/nginx/nginx.conf

22
nginx.conf Normal file
View File

@@ -0,0 +1,22 @@
events {
worker_connections 1024;
}
http {
include mime.types;
sendfile on;
server {
listen 8080;
listen [::]:8080;
# resolver 127.0.0.11;
autoindex off;
server_name _;
server_tokens off;
root /app/;
gzip_static on;
}
}