oneuptime/Accounts/Dockerfile

67 lines
1.2 KiB
Docker
Raw Normal View History

2019-08-02 12:56:16 +00:00
#
# Accounts Dockerfile
#
# Pull base image nodejs image.
2022-03-15 21:44:43 +00:00
FROM node:alpine
2019-08-02 12:56:16 +00:00
2022-01-18 12:34:39 +00:00
# Install bash.
RUN apk update && apk add bash && apk add curl
2021-08-08 12:02:26 +00:00
#Use bash shell by default
SHELL ["/bin/bash", "-c"]
2022-03-01 19:36:15 +00:00
RUN mkdir /usr/src
2022-03-22 11:23:38 +00:00
# Install common
RUN mkdir /usr/src/common
WORKDIR /usr/src/common
COPY ./common/package*.json /usr/src/common/
RUN npm install
COPY ./common /usr/src/common
2022-03-27 11:17:28 +00:00
RUN npm compile
2022-03-22 11:23:38 +00:00
# Install common-server
2022-03-01 19:36:15 +00:00
RUN mkdir /usr/src/common-server
WORKDIR /usr/src/common-server
COPY ./common-server/package*.json /usr/src/common-server/
2022-03-15 21:57:13 +00:00
RUN npm install
2022-03-01 19:36:15 +00:00
COPY ./common-server /usr/src/common-server
2022-03-27 11:17:28 +00:00
RUN npm compile
2022-03-01 19:36:15 +00:00
2022-03-22 11:23:38 +00:00
# Install common-ui
RUN mkdir /usr/src/common-ui
WORKDIR /usr/src/common-ui
COPY ./common-ui/package*.json /usr/src/common-ui/
RUN npm install
COPY ./common-ui /usr/src/common-ui
2022-03-27 11:17:28 +00:00
RUN npm compile
2022-03-22 11:23:38 +00:00
2019-08-02 12:56:16 +00:00
#SET ENV Variables
ENV PRODUCTION=true
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
2019-08-02 12:56:16 +00:00
2022-01-18 12:34:39 +00:00
RUN mkdir /usr/src/app
2019-08-02 12:56:16 +00:00
WORKDIR /usr/src/app
# Install app dependencies
2022-01-19 12:36:43 +00:00
COPY ./accounts/package*.json /usr/src/app/
2022-03-15 21:57:13 +00:00
RUN npm install
2022-02-27 11:51:35 +00:00
RUN npm install -g ts-node
2019-08-02 12:56:16 +00:00
# Copy app source
2022-01-19 12:36:43 +00:00
COPY ./accounts /usr/src/app
2019-08-02 12:56:16 +00:00
# Bundle app source
RUN npm run build
# Expose ports.
# - 3003: accounts
EXPOSE 3003
#Run the app
CMD [ "npm", "start" ]