Changed order of operations in the Dockerfile

This commit is contained in:
StNicolay 2022-10-30 23:08:24 +03:00
parent b7120f2627
commit 3e570dbaff

View File

@ -6,6 +6,11 @@ ENV PYTHONDONTWRITEBYTECODE=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Creates new user
RUN adduser -u 1000 --disabled-password --gecos "" appuser && chown -R appuser /app
# Install deps
RUN apt update && apt full-upgrade -y
RUN apt install curl gcc -y
@ -16,11 +21,8 @@ RUN apt install libmariadb3 libmariadb-dev -y
COPY requirements.txt .
RUN python -m pip install -r requirements.txt
WORKDIR /app
COPY . /app
RUN adduser -u 1000 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser
CMD ["python", "main.py"]