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; + } +}