전
FROM python:3.9.6-buster
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get install -y --no-install-recommends \
vim \
apt-utils \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /web/
WORKDIR /web/
COPY web deploy/entrypoint.sh requirements.txt ./
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
EXPOSE 8000
RUN adduser --disabled-password --gecos '' user
RUN chown -R user:user /web
RUN chmod -R 755 /web
USER user
CMD ./entrypoint.sh
후
FROM python:3.9.6-buster
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN mkdir -p /web/ && adduser --no-create-home --disabled-password --gecos '' user \
&& chown -R user:user /web
WORKDIR /web/
COPY --chmod=755 --chown=user:user web deploy/entrypoint.sh requirements.txt ./
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt \
&& rm -rf requirements.txt
USER user
EXPOSE 8000
CMD ./entrypoint.sh