forked from AnglesHQ/angles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (28 loc) · 904 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# pull official base image
FROM node:16.15.0
# set working directory
WORKDIR /app
EXPOSE 3000/tcp
# variables to configure the swagger doc
ENV REACT_APP_SWAGGER_ANGLES_API_URL=127.0.0.1:3000
ENV REACT_APP_SWAGGER_SCHEMES=http
VOLUME /app/screenshots
VOLUME /app/compares
# required to setup the clean-up crontab
RUN apt-get update
RUN apt-get -y install cron vim jq
RUN apt-get -y --fix-missing install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
# crontab
COPY cleanup /cleanup
RUN cp /cleanup/crontab /etc/cron.d/angles_cleanup
RUN chmod 0644 /etc/cron.d/angles_cleanup
RUN chmod 0644 /etc/crontab
RUN crontab /etc/cron.d/angles_cleanup
# install app dependencies
COPY package.json ./
COPY package-lock.json ./
RUN npm install --silent
# add app
COPY . ./
# start app
CMD sh /app/cleanup/entrypoint.sh && cron && touch /var/log/cron.log && node server.js