chore: optimize image build

This commit is contained in:
zuk 2024-10-13 20:28:11 +02:00
parent 0d9a175438
commit f63d1b185b
2 changed files with 7 additions and 5 deletions

View file

@ -1,7 +1,8 @@
FROM docker.io/python:slim
RUN bash -c 'mkdir /app;\
python -m venv /venv;\
/venv/bin/pip install -r requirements.txt; '
python -m venv /venv;'
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

View file

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