Dockerfile.alpine 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. RUN apk add nginx netcat-openbsd curl vim jq rsync pango pango-dev cairo postgresql-client bash glib fontconfig font-noto
  15. COPY --from=builder /root/.local /root/.local
  16. ENV PATH="/root/.local/bin:$PATH"
  17. # copy the django code
  18. COPY ./src ./app
  19. RUN chgrp -R 0 ./app && \
  20. chmod -R g=u ./app
  21. # change our working directory to the django projcet roo
  22. WORKDIR /app
  23. # create virtual env (notice the location?)
  24. # update pip
  25. # install requirements
  26. #RUN python -m venv /opt/venv && \
  27. #/opt/venv/bin/python -m pip install pip --upgrade && \
  28. #/opt/venv/bin/python -m pip install -r requirements.txt && \
  29. #echo "export PATH=/opt/venv/bin/:$PATH" >> /root/.bashrc && \
  30. #chmod +x config/entrypoint.sh
  31. #EXPOSE 8080
  32. # execute our entrypoint.sh file
  33. CMD ["/app/config/entrypoint-alpine.sh"]
  34. # CMD ["gunicorn", "misfinanzas.wsgi:application", "--bind", "0.0.0.0:8000", "--access-logfile", "-", "--error-logfile", "-", "--log-level", "info"]