chore: optimize image build

This commit is contained in:
zuk 2024-10-13 20:29:29 +02:00
parent f63d1b185b
commit 3c1030a2fe
2 changed files with 3 additions and 2 deletions

View file

@ -1,15 +1,16 @@
FROM docker.io/python:slim
RUN bash -c 'mkdir /app;\
python -m venv /venv;'
WORKDIR /app
COPY requirements.txt /app/
RUN /venv/bin/pip install -r requirements.txt
COPY static /app/static
COPY templates /app/templates
COPY wg_manager /app/wg_manager
COPY wg_connection_manager /app/wg_connection_manager
COPY requirements.txt .env manage.py /app/
WORKDIR /app
RUN bash -c '/venv/bin/python manage.py migrate ; \
/venv/bin/python manage.py collectstatic --noinput'
EXPOSE 4000

View file

@ -1,10 +1,10 @@
FROM docker.io/python:slim
RUN bash -c 'mkdir /app;\
python -m venv /venv'
WORKDIR /app
COPY requirements-worker.txt /app/
RUN /venv/bin/pip install -r requirements-worker.txt
COPY wg_manager /app/wg_manager
COPY wg_connection_manager_worker /app/wg_connection_manager_worker
COPY .env /app/
WORKDIR /app
CMD ["/venv/bin/celery","-A","wg_connection_manager_worker.tasks","worker","--loglevel=INFO"]