Last active
November 25, 2019 17:35
-
-
Save carlosdelfino/554601132005c8b66f04359519e731be to your computer and use it in GitHub Desktop.
adjusts in docker files to use in quran.com project frontend v1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.DS_Store | |
.vscode | |
.idea/ | |
.awcache | |
.circleci | |
.github | |
.storybook | |
.git | |
build | |
dist | |
docs | |
coverage/ | |
tests/ | |
node_modules | |
/node_modules | |
static/dist | |
test-results.xml | |
npm-debug.log | |
npm-debug.log.* | |
webpack-stats.json | |
webpack-assets.json | |
bundle-stats.json | |
selenium-debug.log | |
webpack-stats.debug.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:8.9 | |
RUN apt-get -y update | |
RUN apt-get -y install apt-utils | |
RUN 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-lock.json package.json ./ | |
RUN npm install --silent --no-progress | |
RUN npm install -g pm2 | |
RUN mkdir /quran | |
RUN cp -a package-lock.json package.json /tmp/node_modules /quran | |
WORKDIR /quran | |
ADD tsconfig.json tsconfig.json | |
ADD src ./src | |
ADD config ./config | |
ADD internal ./internal | |
ADD static ./static | |
ADD shared ./shared | |
RUN ls -lha | |
#### build client and server | |
ENV SENTRY_KEY_CLIENT https://app.getsentry.com | |
ENV SENTRY_KEY_SERVER https://app.getsentry.com | |
ENV PORT 8000 | |
ENV SEGMENTS_KEY= | |
# Quran.com - development app, no need to worry! | |
ENV API_URL http://api.quran.com:3000 | |
#ENV API_URL=https://staging.quran.com:3000 | |
ENV ONE_QURAN_URL https://one.quran.com | |
#ENV ONE_QURAN_URL=http://localhost:3030 | |
ENV FACEBOOK_APP_ID=1599019233731707 | |
#ENV FACEBOOK_APP_ID appid | |
ENV FONTS_URL=//quran-1f14.kxcdn.com | |
ENV AUDIO_CDN=//audio.qurancdn.com | |
ENV NODE_ENV production | |
ENV NODE_PATH "./dist" | |
RUN npm run build:client | |
RUN npm run build:server | |
# ssh keys | |
WORKDIR /root | |
ADD .ssh /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 | |
EXPOSE 8000 | |
CMD ["supervisord", "--nodaemon", "-c", "/etc/supervisor/supervisord.conf"] |
English:
Added environment variables contained in the .env file and adjusted with pre-existing ones in the old dockerfile.
The .env file is not needed in Docker since you can create such variables through Dockerfile itself, so it is ignored through the .dockerignore file..
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Portuguese:
Adicionado as variáveis de ambiente contidas no arquivo .env e ajustado com as pré existentes no antigo dockerfile.
O arquivo .env não é preciso no Docker já que se pode criar tais variáveis através do próprio Dockerfile, portanto ele é ignorado através do arquivo .dockerignore.