2023-03-03 16:16:40 +03:00
|
|
|
FROM alpine:latest as build
|
|
|
|
RUN apk add --no-cache python3 python3-dev py3-pip mariadb-dev build-base
|
|
|
|
RUN pip install --no-cache-dir wheel
|
2023-02-18 19:01:13 +03:00
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
2023-03-03 16:16:40 +03:00
|
|
|
RUN pip wheel --no-cache-dir -w /app/wheels -r requirements.txt
|
|
|
|
|
|
|
|
FROM alpine:latest as run
|
2023-03-06 16:06:43 +03:00
|
|
|
RUN apk add --no-cache python3 py3-setuptools py3-pip make mariadb-connector-c-dev
|
2023-03-03 16:16:40 +03:00
|
|
|
COPY --from=build /app /app
|
|
|
|
WORKDIR /app
|
|
|
|
RUN pip install --no-cache-dir --find-links /app/wheels -r requirements.txt
|
2023-03-06 16:06:43 +03:00
|
|
|
RUN pip cache purge && apk del py3-pip && rm -rf /var/cache/apk/* && rm -rf /app/wheels
|
2023-02-18 19:01:13 +03:00
|
|
|
CMD make prod
|
|
|
|
EXPOSE 8000
|