TEXT   60

Dockerfile

Guest on 21st September 2022 02:11:52 PM

  1. FROM node:10 AS webpack
  2.  
  3. RUN useradd --shell /bin/bash --user-group --create-home webpack
  4. USER webpack
  5. RUN mkdir -p /home/webpack/app
  6. WORKDIR /home/webpack/app
  7. COPY --chown=webpack:webpack package*.json ./
  8. RUN npm install
  9. COPY --chown=webpack:webpack webpack.config.js .
  10. COPY --chown=webpack:webpack assets/ assets/
  11. RUN npm run build
  12. RUN npm prune --production
  13. EXPOSE 3000
  14.  
  15. FROM python:3.6 AS wagtail
  16.  
  17. ARG ENV=production
  18. ENV PYTHONUNBUFFERED 1
  19. ENV DJANGO_SETTINGS_MODULE indeelabs.settings.${ENV}
  20. RUN useradd --shell /bin/bash --user-group --create-home wagtail
  21. COPY requirements.*.txt /home/wagtail/
  22. RUN pip install -r /home/wagtail/requirements.${ENV}.txt
  23. COPY --chown=wagtail:wagtail wagtail/ /home/wagtail/app/
  24. USER wagtail
  25. RUN mkdir -p /home/wagtail/static && mkdir -p /home/wagtail/media
  26. COPY --chown=wagtail:wagtail --from=webpack /home/webpack/app/dist/ /home/wagtail/dist/
  27. WORKDIR /home/wagtail/app
  28. EXPOSE 8000
  29. CMD exec gunicorn indeelabs.wsgi:application --bind 0.0.0.0:8000 --workers 3

Raw Paste


Login or Register to edit or fork this paste. It's free.