Files
oneuptime/dashboard/Dockerfile.dev
2022-01-24 18:50:17 +00:00

53 lines
1.2 KiB
Docker

#
# OneUptime Docs Dockerfile
#
# Pull base image nodejs image.
FROM node:17-alpine
# Install bash.
RUN apk update && apk add bash && apk add curl
#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 ./dashboard/package.json /usr/src/app/package.json
COPY ./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.
# - 1445: OneUptime Docs
EXPOSE 1445
#Run the app
CMD [ "npm", "run", "dev" ]