11FROM python:3.7-alpine AS base
22
3- FROM base as builder
3+ FROM base AS builder
44
5- ENV PIP_DISABLE_PIP_VERSION_CHECK on
6- ENV PYTHONDONTWRITEBYTECODE 1
7- ENV PYTHONUNBUFFERED 1
5+ ENV PIP_DISABLE_PIP_VERSION_CHECK=on
6+ ENV PYTHONUNBUFFERED=1
87
9- RUN apk update && \
10- apk add --no-cache build-base musl-dev python3-dev libffi-dev openssl-dev
8+ RUN apk update
9+ RUN apk upgrade
10+ RUN apk add --no-cache build-base musl-dev python3-dev libffi-dev openssl-dev
1111
1212RUN python -m venv /opt/venv
1313# Make sure we use the virtualenv:
1414ENV PATH="/opt/venv/bin:$PATH"
1515
1616COPY poetry.lock pyproject.toml ./
1717
18- RUN pip install poetry && \
19- poetry config virtualenvs.create false && \
20- poetry install --no-dev --no-interaction
18+ RUN pip install poetry
19+ RUN poetry config virtualenvs.create false
20+ RUN poetry install --only=main --compile --no-interaction --no-cache
2121
2222# The `built-image` stage is the base for all remaining images
2323# Pulls all of the built dependencies from the builder stage
24- FROM base as built-image
25- ENV PIP_DISABLE_PIP_VERSION_CHECK on
26- ENV PYTHONDONTWRITEBYTECODE 1
27- ENV PYTHONUNBUFFERED 1
24+ FROM base AS built-image
25+ ENV PIP_DISABLE_PIP_VERSION_CHECK=on
26+ ENV PYTHONUNBUFFERED=1
27+
28+ RUN apk update
29+ RUN apk upgrade
30+ RUN rm -rf /var/cache/apk/*
2831
2932# copy installed deps from builder image
3033COPY --from=builder /opt/venv /opt/venv
@@ -34,12 +37,12 @@ ENV PATH="/opt/venv/bin:$PATH"
3437
3538# The `app` stage is used as the base for images that don't
3639# need the development dependencies
37- FROM built-image as app
40+ FROM built-image AS app
3841
3942COPY . /src
4043WORKDIR /src
4144
42- # The `Prod ` stage creates an image that will run the application using a
45+ # The `prod ` stage creates an image that will run the application using a
4346# production webserver and the `environments/production.py` configuration
44- FROM app As Prod
47+ FROM app AS prod
4548ENTRYPOINT ["python3" , "-m" , "pybot" ]
0 commit comments