oneuptime/admin-dashboard/Dockerfile.dev
2022-02-12 09:51:52 +00:00

56 lines
1.3 KiB
Docker

#
# Admin Dashboard Dockerfile
#
# Pull base image nodejs image.
FROM node:17-alpine
# Install bash.
RUN apk update && apk add bash && apk add curl
# Install python
RUN apk update && apk add --no-cache --virtual .gyp python3 make g++
#Use bash shell by default
SHELL ["/bin/bash", "-c"]
# Install common-ui
RUN mkdir /usr/src
RUN mkdir /usr/src/common-ui
WORKDIR /usr/src/common-ui
COPY ./common-ui/package*.json /usr/src/common-ui/
RUN npm ci --only=production
COPY ./common-ui /usr/src/common-ui
#SET ENV Variables
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
# Because of this error during build
# Error message "error:0308010C:digital envelope routines::unsupported"
ENV NODE_OPTIONS=--openssl-legacy-provider
# Install nodemon
RUN npm install nodemon -g
WORKDIR /usr/src/app
# Copy package.json files
COPY ./admin-dashboard/package.json /usr/src/app/package.json
COPY ./admin-dashboard/package-lock.json /usr/src/app/package-lock.json
# Install app dependencies
RUN npm ci --legacy-peer-deps
# Create .cache folder with necessary permissions for React-based apps
# https://stackoverflow.com/questions/67087735/eacces-permission-denied-mkdir-usr-app-node-modules-cache-how-can-i-creat
RUN mkdir -p node_modules/.cache && chmod -R 777 node_modules/.cache
# Expose ports.
# - 3100: OneUptime-admin-dashboard
EXPOSE 3100
#Run the app
CMD [ "npm", "run", "dev" ]