forked from quran/quran.com-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (38 loc) · 1.3 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM node:6.3
ENV NODE_ENV production
ENV API_URL http://api.quran.com:3000
ENV SENTRY_KEY_CLIENT https://[email protected]/80639
ENV SENTRY_KEY_SERVER https://44c105328ae544ae9928f9eb74b40061:[email protected]/80639
# It's okay because it's only the APP ID
ENV FACEBOOK_APP_ID 1557596491207315
ENV ONE_QURAN_URL https://one.quran.com
ENV PORT 8000
ENV NODE_PATH "./src"
RUN apt-get -y update && apt-get -y install supervisor ssh rsync
# logrotate
RUN apt-get -y install logrotate
COPY docker/supervisord.conf /etc/supervisor/supervisord.conf
COPY docker/pm2.logrotate.conf /etc/logrotate.d/pm2
RUN cp /etc/cron.daily/logrotate /etc/cron.hourly
# cache npm install when package.json hasn't changed
WORKDIR /tmp
ADD package.json package.json
RUN npm install --silent --no-progress
RUN npm install -g pm2
RUN mkdir /quran
RUN cp -a /tmp/node_modules /quran
WORKDIR /quran
ADD . /quran/
RUN npm run build:client
RUN npm run build:server
# ssh keys
WORKDIR /root
RUN mv /quran/.ssh /root/
# upload js and css
WORKDIR /quran/static/dist
RUN rsync --update --progress -raz . [email protected]:zones/assets/
# go back to /quran
WORKDIR /quran
ENV NODE_PATH "./dist"
EXPOSE 8000
CMD ["supervisord", "--nodaemon", "-c", "/etc/supervisor/supervisord.conf"]