| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- # yup, python 3.11!
- FROM python:3.11-alpine as builder
- # install nginx y otras cosas
- RUN apk add nginx netcat-openbsd curl vim jq rsync pango pango-dev cairo postgresql-client bash glib fontconfig font-noto
- COPY ./nginx/default.conf /etc/nginx/nginx.conf
- COPY ./src/requirements.txt requirements.txt
- RUN pip install --user --no-cache-dir -r requirements.txt
- # link nginx logs to container stdout
- RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
- ln -sf /dev/stderr /var/log/nginx/error.log && \
- chgrp -R 0 /var/lib/nginx && \
- chmod -R g=u /var/lib/nginx
- FROM python:3.11-alpine as main
- COPY --from=builder /root/.local /root/.local
- ENV PATH="/root/.local/bin:$PATH"
- # copy the django code
- COPY ./src ./app
- RUN chgrp -R 0 ./app && \
- chmod -R g=u ./app
- # change our working directory to the django projcet roo
- WORKDIR /app
- # create virtual env (notice the location?)
- # update pip
- # install requirements
- #RUN python -m venv /opt/venv && \
- #/opt/venv/bin/python -m pip install pip --upgrade && \
- #/opt/venv/bin/python -m pip install -r requirements.txt && \
- #echo "export PATH=/opt/venv/bin/:$PATH" >> /root/.bashrc && \
- #chmod +x config/entrypoint.sh
- #EXPOSE 8080
- # execute our entrypoint.sh file
- # CMD ["./config/entrypoint.sh"]
- CMD ["gunicorn", "misfinanzas.wsgi:application", "--bind", "0.0.0.0:8000", "--access-logfile", "-", "--error-logfile", "-", "--log-level", "info"]
|