(frontend) add docker file
This commit is contained in:
parent
7860f9aac4
commit
734417b0a6
2
apps/frontend/.dockerignore
Normal file
2
apps/frontend/.dockerignore
Normal file
@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
dist
|
||||
23
apps/frontend/Dockerfile
Normal file
23
apps/frontend/Dockerfile
Normal 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;"]
|
||||
8
apps/frontend/nginx/nginx.conf
Normal file
8
apps/frontend/nginx/nginx.conf
Normal 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;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user