-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
31 lines (25 loc) · 895 Bytes
/
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
# syntax=docker/dockerfile:1.4
FROM python:3.12.0-alpine AS builder
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
ENV CC='ccache gcc'
RUN \
apk add --update --no-cache gcc ccache musl-dev libffi-dev \
&& pip install --no-cache-dir build
COPY poetry.lock pyproject.toml /src/
COPY get_oracle_a1 /src/get_oracle_a1
RUN python -m build --wheel -o /tmp/dist /src
RUN \
--mount=type=cache,target=/root/.cache/pip \
--mount=type=cache,target=/root/.cache/ccache \
pip wheel /tmp/dist/*.whl --wheel-dir /wheel
FROM python:3.12.0-alpine
MAINTAINER 'Byeonghoon Isac Yoo <[email protected]>'
RUN \
--mount=type=bind,target=/wheel,from=builder,source=/wheel \
--mount=type=bind,target=/tmp/wheel,from=builder,source=/tmp/dist \
pip install \
--no-cache-dir \
--no-index \
--find-links=/wheel \
/tmp/wheel/*.whl
ENTRYPOINT ["/usr/local/bin/get_oracle_a1"]