-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfileOracleLinux
More file actions
51 lines (35 loc) · 1.21 KB
/
Copy pathDockerfileOracleLinux
File metadata and controls
51 lines (35 loc) · 1.21 KB
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
FROM eurolinux/oracle-linux-9:oracle-linux-9-9.4.3-arm64 AS build
RUN dnf install python3.12 python3.12-devel -y
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
ENV UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
UV_PYTHON_DOWNLOADS=never \
UV_PYTHON=python3.12 \
UV_PROJECT_ENVIRONMENT=/app
COPY pyproject.toml /_lock/
COPY uv.lock /_lock/
RUN --mount=type=cache,target=/root/.cache
RUN cd /_lock && uv sync \
--locked \
--no-dev \
--no-install-project
# Clean up unnecessary files
RUN dnf clean all
RUN rm -rf /var/cache/dnf /var/lib/dnf/history.* /usr/share/doc /usr/share/man /usr/share/info /usr/share/locale /tmp/* /var/tmp/* /root/.cache
FROM eurolinux/oracle-linux-9:oracle-linux-9-9.4.3-arm64
ENV PATH=/app/bin:$PATH
RUN groupadd -r app
RUN useradd -r -d /app -g app -N app
STOPSIGNAL SIGINT
RUN dnf install python3.12 -y
RUN dnf clean all
RUN rm -rf /var/cache/dnf /var/lib/dnf/history.* /usr/share/doc /usr/share/man /usr/share/info /usr/share/locale /tmp/* /var/tmp/* /root/.cache
COPY --from=build --chown=app:app /app /app
USER app
WORKDIR /app
COPY /greens/ greens/
COPY /tests/ tests/
COPY .env greens/
RUN python -V
RUN python -Im site
RUN python -Ic 'import uvicorn'