2021-06-21 21:08:35 +00:00
|
|
|
#
|
2021-11-18 21:24:16 +00:00
|
|
|
# OneUptime Docs Dockerfile
|
2021-06-21 21:08:35 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# Pull base image nodejs image.
|
2022-03-15 21:44:43 +00:00
|
|
|
FROM node:alpine
|
2021-06-21 21:08:35 +00:00
|
|
|
|
2022-01-18 12:34:39 +00:00
|
|
|
# Install bash.
|
|
|
|
RUN apk update && apk add bash && apk add curl
|
|
|
|
|
2022-01-29 13:07:52 +00:00
|
|
|
|
|
|
|
# Install python
|
2022-01-29 13:18:01 +00:00
|
|
|
RUN apk update && apk add --no-cache --virtual .gyp python3 make g++
|
2022-01-29 13:07:52 +00:00
|
|
|
|
2021-08-08 12:02:26 +00:00
|
|
|
#Use bash shell by default
|
|
|
|
SHELL ["/bin/bash", "-c"]
|
2022-04-22 20:28:36 +00:00
|
|
|
RUN npm install typescript -g
|
2021-08-08 12:02:26 +00:00
|
|
|
|
2022-01-21 21:38:09 +00:00
|
|
|
RUN mkdir /usr/src
|
2022-03-22 11:23:38 +00:00
|
|
|
|
|
|
|
# Install common
|
2022-04-22 20:12:57 +00:00
|
|
|
RUN mkdir /usr/src/Common
|
|
|
|
WORKDIR /usr/src/Common
|
|
|
|
COPY ./Common/package*.json /usr/src/Common/
|
2022-03-22 11:23:38 +00:00
|
|
|
RUN npm install
|
2022-04-22 20:12:57 +00:00
|
|
|
COPY ./Common /usr/src/Common
|
2022-04-22 20:17:50 +00:00
|
|
|
RUN npm run compile
|
2022-03-22 11:23:38 +00:00
|
|
|
|
2022-04-11 13:11:16 +00:00
|
|
|
# Install CommonServer
|
|
|
|
RUN mkdir /usr/src/CommonServer
|
|
|
|
WORKDIR /usr/src/CommonServer
|
|
|
|
COPY ./CommonServer/package*.json /usr/src/CommonServer/
|
2022-03-15 21:57:13 +00:00
|
|
|
RUN npm install
|
2022-04-11 13:11:16 +00:00
|
|
|
COPY ./CommonServer /usr/src/CommonServer
|
2022-04-22 20:17:50 +00:00
|
|
|
RUN npm run compile
|
2022-03-01 19:45:52 +00:00
|
|
|
|
2022-04-11 13:11:16 +00:00
|
|
|
# Install CommonUI
|
|
|
|
RUN mkdir /usr/src/CommonUI
|
|
|
|
WORKDIR /usr/src/CommonUI
|
|
|
|
COPY ./CommonUI/package*.json /usr/src/CommonUI/
|
2022-03-15 21:57:13 +00:00
|
|
|
RUN npm install
|
2022-04-11 13:11:16 +00:00
|
|
|
COPY ./CommonUI /usr/src/CommonUI
|
2022-04-22 20:17:50 +00:00
|
|
|
RUN npm run compile
|
2022-01-19 12:36:43 +00:00
|
|
|
|
2021-06-21 21:08:35 +00:00
|
|
|
#SET ENV Variables
|
|
|
|
|
|
|
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
|
|
|
|
2022-01-18 12:53:30 +00:00
|
|
|
# Because of this error during build
|
|
|
|
# Error message "error:0308010C:digital envelope routines::unsupported"
|
|
|
|
ENV NODE_OPTIONS=--openssl-legacy-provider
|
|
|
|
|
2022-02-27 11:02:40 +00:00
|
|
|
|
|
|
|
|
2021-06-22 08:24:10 +00:00
|
|
|
|
2021-06-21 21:08:35 +00:00
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
# Copy package.json files
|
2022-04-22 20:40:29 +00:00
|
|
|
COPY ./Dashboard/package.json /usr/src/app/package.json
|
|
|
|
COPY ./Dashboard/package-lock.json /usr/src/app/package-lock.json
|
2021-06-21 21:47:55 +00:00
|
|
|
|
2021-06-21 21:08:35 +00:00
|
|
|
|
|
|
|
# Install app dependencies
|
2022-03-15 21:57:13 +00:00
|
|
|
RUN npm install
|
2021-06-21 21:08:35 +00:00
|
|
|
|
2021-06-25 13:13:48 +00:00
|
|
|
# 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
|
|
|
|
|
2021-06-21 21:08:35 +00:00
|
|
|
# Expose ports.
|
2021-11-18 21:24:16 +00:00
|
|
|
# - 1445: OneUptime Docs
|
2021-06-21 21:08:35 +00:00
|
|
|
EXPOSE 1445
|
|
|
|
|
|
|
|
#Run the app
|
|
|
|
CMD [ "npm", "run", "dev" ]
|