Skip to content

Commit

Permalink
removed unused commands from dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
bugraahmetcaglar committed Apr 3, 2024
1 parent b2923a7 commit 2c6fdc6
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
FROM python:3.8.14
ARG PYTHON_VERSION=3.11-rc-bullseye
FROM python:${PYTHON_VERSION} as python
FROM python as builder

RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
default-libmysqlclient-dev

ARG BUILD_ENVIRONMENT=local

COPY ./requirements /requirements
RUN pip wheel --wheel-dir /usr/src/app/wheels \
-r "/requirements/${BUILD_ENVIRONMENT}.txt"

FROM python as runner

ARG APP_HOME=/code
WORKDIR ${APP_HOME}

ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV TZ="Europe/Istanbul"

COPY --from=builder /usr/src/app/wheels /wheels/

RUN mkdir /code
WORKDIR /code
RUN pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* \
&& rm -rf /wheels/

COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY --chown=django:django . ${APP_HOME}

COPY . /code/
USER django

0 comments on commit 2c6fdc6

Please sign in to comment.