freeleaps_frontend/Dockerfile

27 lines
720 B
Docker

# build stage
FROM node:lts-alpine as build-stage
ARG CONTAINER_APP_ROOT="/app"
RUN npm update npm -g
RUN npm config set "@fortawesome:registry" https://npm.fontawesome.com/
RUN npm config set "//npm.fontawesome.com/:_authToken" 58624E90-2685-43C6-BF0F-0BFECCE11CD2
RUN npm install -g http-server
WORKDIR ${CONTAINER_APP_ROOT}
COPY frontend/package*.json ./
RUN npm install
COPY frontend/*.js ./
COPY frontend/*.html ./
COPY frontend/src ./src
COPY frontend/public ./public
RUN npm run build
# production stage
FROM nginx:1.25.2 as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY frontend/nginx_docker.conf /etc/nginx/conf.d/default.conf
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]