From c2fbccf5f88fb3313512db3d97f443c05aa3227a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andres=20Patin=CC=83o?= <97bermudez.andres@gmail.com> Date: Thu, 14 May 2026 21:37:52 -0500 Subject: [PATCH] chore: add Docker and Nginx configuration for deployment --- Dockerfile | 21 +++++++++++++++++++++ nginx.conf | 17 +++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Dockerfile create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..75a6871 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM node:22.12-alpine AS build + +WORKDIR /app + +RUN npm install -g pnpm@10.33.0 + +COPY package.json pnpm-lock.yaml ./ +RUN pnpm install --frozen-lockfile + +COPY . . +RUN pnpm run build + +FROM nginx:alpine + +COPY --from=build /app/dist/task-challenge/browser /usr/share/nginx/html + +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..e6bcca2 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,17 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location /api { + proxy_pass https://api.emi.challenge.berand97.dev; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_ssl_server_name on; + } +}