Dockerfile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # yup, python 3.11!
  2. FROM python:3.11-slim
  3. <<<<<<< HEAD
  4. # install nginx
  5. RUN apt-get update && apt-get install nginx netcat-openbsd rsync -y
  6. =======
  7. # install nginx y otras cosas
  8. RUN apt-get update && apt-get install nginx netcat-openbsd curl vim jq -y
  9. >>>>>>> c04abab64cc16d19cf44b2b6e95eb68cccfb37b5
  10. # copy our nginx configuration to overwrite nginx defaults
  11. RUN rm /etc/nginx/sites-enabled/default
  12. RUN rm /etc/nginx/sites-available/default
  13. COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
  14. # link nginx logs to container stdout
  15. RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
  16. # copy the django code
  17. COPY ./src ./app
  18. RUN chgrp -R 0 ./app && chmod -R g=u ./app
  19. RUN chgrp -R 0 /var/lib/nginx && chmod -R g=u /var/lib/nginx
  20. # change our working directory to the django projcet roo
  21. WORKDIR /app
  22. # create virtual env (notice the location?)
  23. # update pip
  24. # install requirements
  25. RUN python -m venv /opt/venv && \
  26. /opt/venv/bin/python -m pip install pip --upgrade && \
  27. /opt/venv/bin/python -m pip install -r requirements.txt
  28. # make our entrypoint.sh executable
  29. RUN chmod +x config/entrypoint.sh
  30. EXPOSE 80
  31. # execute our entrypoint.sh file
  32. CMD ["./config/entrypoint.sh"]