refactor dockerfile so that we dont pip install from the top every time

pull/3/head
lalanza808 5 years ago
parent 256b39c728
commit f2a5480861

@ -2,13 +2,14 @@ FROM python:3
RUN apt-get update
RUN apt-get install python3 python3-venv -y
RUN useradd -M -s /bin/bash -b /srv/xmrauctions xmrauctions
COPY requirements.txt /tmp/requirements.txt
RUN python3 -m venv /tmp/venv && /tmp/venv/bin/pip install -r /tmp/requirements.txt
COPY . /srv/xmrauctions
RUN cp -r /tmp/venv/ /srv/xmrauctions/.venv
RUN useradd -s /bin/bash -d /srv/xmrauctions xmrauctions
RUN chown -R xmrauctions:xmrauctions /srv/xmrauctions
RUN chmod +x /srv/xmrauctions/bin/*
USER xmrauctions
WORKDIR /srv/xmrauctions
RUN python3 -m venv .venv && . .venv/bin/activate && pip install -r requirements.txt
RUN chmod +x ./bin/*
ENTRYPOINT ["./bin/entrypoint"]