mirror of
https://github.com/sheptikhinv/timers.git
synced 2026-02-07 07:41:36 +05:00
Add Docker setup for Nginx serving built Node app
Introduce a multi-stage Dockerfile to build and serve a Node.js application using Nginx. Define a custom Nginx configuration for optimized static file handling and enable gzip compression.
This commit is contained in:
parent
15db906f33
commit
f94c90456f
2 changed files with 62 additions and 0 deletions
11
Dockerfile
Normal file
11
Dockerfile
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
FROM node:20-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:stable
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
COPY .docker/app/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
EXPOSE 80
|
||||
Loading…
Add table
Add a link
Reference in a new issue