Skip to content

Instantly share code, notes, and snippets.

@carlosdelfino
Created November 25, 2019 12:06
Show Gist options
  • Save carlosdelfino/23ff502fa4fdcde24da1702f24c12c3c to your computer and use it in GitHub Desktop.
Save carlosdelfino/23ff502fa4fdcde24da1702f24c12c3c to your computer and use it in GitHub Desktop.
adjusts in docker files to use in quran.com project frontend v1
*.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
FROM node:8.9
ENV NODE_ENV production
ENV API_URL http://api.quran.com:3000
ENV SENTRY_KEY_CLIENT https://app.getsentry.com
ENV SENTRY_KEY_SERVER https://app.getsentry.com
ENV FACEBOOK_APP_ID appid
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 apt-utils
# 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
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 . ahmedre@rsync.keycdn.com:zones/assets/
# go back to /quran
WORKDIR /quran
ENV NODE_PATH "./dist"
EXPOSE 8000
CMD ["supervisord", "--nodaemon", "-c", "/etc/supervisor/supervisord.conf"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment