Dockerfile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # yup, python 3.11!
  2. FROM python:3.11-alpine as builder
  3. # install nginx y otras cosas
  4. RUN apk add nginx netcat-openbsd curl vim jq rsync pango pango-dev cairo postgresql-client bash glib fontconfig font-noto
  5. COPY ./nginx/default.conf /etc/nginx/nginx.conf
  6. COPY ./src/requirements.txt requirements.txt
  7. RUN pip install --user --no-cache-dir -r requirements.txt
  8. # link nginx logs to container stdout
  9. RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
  10. ln -sf /dev/stderr /var/log/nginx/error.log && \
  11. chgrp -R 0 /var/lib/nginx && \
  12. chmod -R g=u /var/lib/nginx
  13. FROM python:3.11-alpine as main
  14. COPY --from=builder /root/.local /root/.local
  15. ENV PATH="/root/.local/bin:$PATH"
  16. # copy the django code
  17. COPY ./src ./app
  18. RUN chgrp -R 0 ./app && \
  19. chmod -R g=u ./app
  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. #echo "export PATH=/opt/venv/bin/:$PATH" >> /root/.bashrc && \
  29. #chmod +x config/entrypoint.sh
  30. #EXPOSE 8080
  31. # execute our entrypoint.sh file
  32. # CMD ["./config/entrypoint.sh"]
  33. CMD ["gunicorn", "misfinanzas.wsgi:application", "--bind", "0.0.0.0:8000", "--access-logfile", "-", "--error-logfile", "-", "--log-level", "info"]