oneuptime/probe-api/Dockerfile

41 lines
755 B
Docker
Raw Normal View History

#
2022-01-19 12:23:34 +00:00
# OneUptime-probe-api Dockerfile
#
# Pull base image nodejs image.
2022-01-18 11:59:26 +00:00
FROM node:17-alpine
2022-01-18 12:34:39 +00:00
# Install bash.
RUN apk update && apk add bash && apk add curl
#Use bash shell by default
SHELL ["/bin/bash", "-c"]
2022-01-19 12:23:34 +00:00
# Install common-server
2022-01-19 18:21:34 +00:00
RUN mkdir /usr/src
2022-01-19 12:23:34 +00:00
RUN mkdir /usr/src/common-server
WORKDIR /usr/src/common-server
COPY ../common-server/package*.json /usr/src/common-server/
RUN npm ci --only=production
COPY ../common-server /usr/src/common-server
#SET ENV Variables
ENV PRODUCTION=true
2022-01-18 12:34:39 +00:00
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
2022-01-19 12:23:34 +00:00
COPY ./probe-api/package*.json /usr/src/app/
RUN npm ci --only=production
# Bundle app source
2022-01-19 12:23:34 +00:00
COPY ./probe-api /usr/src/app
# Expose ports.
EXPOSE 3400
#Run the app
CMD [ "npm", "start"]