(frontend) add docker file

This commit is contained in:
Halit Aksoy 2024-10-04 23:31:55 +03:00
parent 7860f9aac4
commit 734417b0a6
3 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,2 @@
node_modules
dist

23
apps/frontend/Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM node:20-alpine3.19 AS build
WORKDIR /app
COPY package.json ./
COPY yarn.lock ./
RUN yarn install
COPY . ./
RUN yarn build
FROM nginx:stable-alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 3000
CMD ["nginx", "-g", "daemon off;"]

View File

@ -0,0 +1,8 @@
server {
listen 3000;
location / {
root /usr/share/nginx/html/;
include /etc/nginx/mime.types;
try_files $uri $uri/ /index.html;
}
}