forked from buerokratt/CronManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.python
More file actions
75 lines (58 loc) · 2.12 KB
/
Copy pathDockerfile.python
File metadata and controls
75 lines (58 loc) · 2.12 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM eclipse-temurin:17-jdk AS build
WORKDIR /workspace/app
# Install minimal dependencies for uv
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Install uv using unmanaged installation to /usr/local/uv
RUN mkdir -p /usr/local/uv && \
curl -LsSf https://astral.sh/uv/install.sh | env UV_UNMANAGED_INSTALL="/usr/local/uv" sh && \
ln -s /usr/local/uv/uv /usr/local/bin/uv
# Let uv install and manage Python 3.12.10
RUN uv python install 3.12.10
# Continue with your existing steps
COPY gradlew .
COPY gradlew.bat .
COPY gradle gradle
COPY build.gradle .
COPY src src
COPY .env .env
COPY scripts scripts
COPY DSL DSL
RUN chmod 754 ./gradlew
RUN ./gradlew -Pprod clean bootJar
RUN mkdir -p build/libs && (cd build/libs; jar -xf *.jar)
FROM eclipse-temurin:17-jdk
VOLUME /build/tmp
# Install minimal dependencies for uv and jq
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
jq \
&& rm -rf /var/lib/apt/lists/*
# Install uv using unmanaged installation to /usr/local/uv
RUN mkdir -p /usr/local/uv && \
curl -LsSf https://astral.sh/uv/install.sh | env UV_UNMANAGED_INSTALL="/usr/local/uv" sh && \
ln -s /usr/local/uv/uv /usr/local/bin/uv
# Let uv install and manage Python 3.12.10
RUN uv python install 3.12.10
# Creating python virtual environment using uv with uv-managed Python
RUN uv venv /app/python_virtual_env --python 3.12.10
ARG DEPENDENCY=/workspace/app/build/libs
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
COPY DSL /DSL
COPY scripts /app/scripts/
COPY constants.ini /app/constants.ini
RUN chmod a+x /app/scripts/*
ENV application.config-path=/DSL
COPY .env /app/.env
RUN echo BUILDTIME=`date +%s` >> /app/.env
RUN adduser cronmanager
RUN chown -R cronmanager:cronmanager /app
RUN chown -R cronmanager:cronmanager /DSL
USER cronmanager
EXPOSE 9010
ENTRYPOINT ["java","-cp","app:app/lib/*","ee.buerokratt.cronmanager.CronManagerApplication"]