updated docker path
This commit is contained in:
parent
8d5fc1f92e
commit
f7a22d391b
4 changed files with 19 additions and 21 deletions
19
docker/Dockerfile
Normal file
19
docker/Dockerfile
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
# docker buildx build --platform=linux/amd64 -f docker/Dockerfile . -t hrms-git.chin.in.th/bma-hrms/hrms-user:0.1
|
||||||
|
|
||||||
|
# Build Stage
|
||||||
|
FROM node:lts-alpine AS build-stage
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm install
|
||||||
|
COPY ./ .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Production Stage
|
||||||
|
FROM nginx:stable-alpine AS production-stage
|
||||||
|
RUN mkdir /app
|
||||||
|
COPY --from=build-stage /app/dist /app
|
||||||
|
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
|
RUN chmod u+x /usr/local/bin/entrypoint.sh
|
||||||
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
21
Dockerfile
21
Dockerfile
|
|
@ -1,21 +0,0 @@
|
||||||
# docker build . -t docker.frappet.com/demo/fe:latest
|
|
||||||
FROM node:latest as build-stage
|
|
||||||
WORKDIR /app
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm install
|
|
||||||
COPY ./ .
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM nginx as production-stage
|
|
||||||
|
|
||||||
RUN mkdir /app
|
|
||||||
COPY --from=build-stage /app/dist /app
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
|
||||||
|
|
||||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
||||||
RUN chmod u+x /usr/local/bin/entrypoint.sh
|
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue