oneuptime/lighthouse-runner/Dockerfile

46 lines
876 B
Docker
Raw Normal View History

2021-06-30 11:56:08 +00:00
#
2021-11-22 11:24:15 +00:00
# lighthouse-runner Dockerfile
2021-06-30 11:56:08 +00:00
#
# Pull base image nodejs image.
2022-02-12 09:51:52 +00:00
FROM node:17-alpine
2021-06-30 11:56:08 +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-01-19 12:23:34 +00:00
# Install common-server
2022-01-21 21:49:30 +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
2022-01-21 21:10:14 +00:00
COPY ./common-server/package*.json /usr/src/common-server/
2022-01-19 12:23:34 +00:00
RUN npm ci --only=production
2022-01-21 21:10:14 +00:00
COPY ./common-server /usr/src/common-server
2022-01-19 12:23:34 +00:00
2021-06-30 11:56:08 +00:00
#SET ENV Variables
ENV PRODUCTION=true
2021-08-07 21:51:54 +00:00
ENV CHROME_PATH=/usr/bin/chromium
2021-06-30 11:56:08 +00:00
# Install Chrome.
2022-01-18 13:37:19 +00:00
RUN apk add curl chromium
2021-06-30 11:56:08 +00:00
2022-01-18 12:34:39 +00:00
RUN mkdir /usr/src/app
2021-06-30 11:56:08 +00:00
WORKDIR /usr/src/app
# Install app dependencies
2022-01-19 12:23:34 +00:00
COPY ./lighthouse-runner/package*.json /usr/src/app/
2021-06-30 11:56:08 +00:00
RUN npm ci --only=production
# Bundle app source
2022-01-19 12:23:34 +00:00
COPY ./lighthouse-runner /usr/src/app
2021-06-30 11:56:08 +00:00
# Expose ports.
2021-07-01 13:28:17 +00:00
# - 3015: Lighthouse Runner
EXPOSE 3015
2021-06-30 11:56:08 +00:00
#Run the app
CMD [ "npm", "start"]