-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
54 lines (39 loc) · 1.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# syntax=docker/dockerfile:1.4
ARG PYTHON_IMAGE=pypy:3.9-7.3.15-slim-bookworm
ARG PYTHON=pypy3
ARG PATHON_PATH=/opt/pypy
FROM ${PYTHON_IMAGE} as base
WORKDIR /opt/koe
RUN rm -f /etc/apt/apt.conf.d/docker-clean
################################################################################
FROM base as builder
ARG BUILDPLATFORM
RUN \
--mount=type=cache,id=$BUILDPLATFORM:/var/cache,target=/var/cache,sharing=locked \
set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
build-essential \
make \
;
COPY requirements.txt ./
RUN \
--mount=type=cache,id=$BUILDPLATFORM:.cache/pip,target=.cache/pip,sharing=locked \
pip install --cache-dir .cache/pip -r requirements.txt
################################################################################
FROM base
ARG TARGETPLATFORM
ARG PYTHON
ARG PATHON_PATH
RUN \
--mount=type=cache,id=$TARGETPLATFORM:/var/cache,target=/var/cache,sharing=locked \
set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ffmpeg \
;
COPY --link . .
COPY --link --from=builder ${PATHON_PATH} ${PATHON_PATH}
VOLUME /opt/koe/data
ENV PYTHON "${PYTHON}"
ENTRYPOINT ${PYTHON} -m koe