Dockerfile.debian 1.1 KB

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