From 6b8039da28a646082087c65e057439a40703e2a5 Mon Sep 17 00:00:00 2001 From: Thibault Pouch Date: Fri, 27 Feb 2026 10:38:29 +0100 Subject: [PATCH] feat: add Dockerfile, docker-compose, and nginx configuration for application deployment --- nest-front/Dockerfile | 18 ++++++++++++++++++ nest-front/docker-compose.yml | 6 ++++++ nest-front/nginx.conf | 9 +++++++++ 3 files changed, 33 insertions(+) create mode 100644 nest-front/Dockerfile create mode 100644 nest-front/docker-compose.yml create mode 100644 nest-front/nginx.conf diff --git a/nest-front/Dockerfile b/nest-front/Dockerfile new file mode 100644 index 0000000..202c534 --- /dev/null +++ b/nest-front/Dockerfile @@ -0,0 +1,18 @@ +FROM node:22-alpine AS build + +WORKDIR /app + +COPY package.json package-lock.json ./ +RUN npm ci + +COPY . . +RUN npm run build + +FROM nginx:alpine + +COPY --from=build /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 5173 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/nest-front/docker-compose.yml b/nest-front/docker-compose.yml new file mode 100644 index 0000000..0428972 --- /dev/null +++ b/nest-front/docker-compose.yml @@ -0,0 +1,6 @@ +services: + nest-front: + build: . + ports: + - "5173:5173" + restart: unless-stopped diff --git a/nest-front/nginx.conf b/nest-front/nginx.conf new file mode 100644 index 0000000..36fb97e --- /dev/null +++ b/nest-front/nginx.conf @@ -0,0 +1,9 @@ +server { + listen 5173; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } +}