-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscrapper.Dockerfile
More file actions
47 lines (35 loc) · 1.31 KB
/
scrapper.Dockerfile
File metadata and controls
47 lines (35 loc) · 1.31 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
FROM eclipse-temurin:21-jdk-alpine as build
ENV RELEASE=21
WORKDIR /opt/build
ARG JAR_FILE=scrapper/target/*.jar
COPY ${JAR_FILE} app.jar
RUN java -Djarmode=layertools -jar app.jar extract
RUN $JAVA_HOME/bin/jlink \
--add-modules jdk.crypto.ec,`jdeps --ignore-missing-deps -q -recursive --multi-release ${RELEASE} --print-module-deps -cp 'dependencies/BOOT-INF/lib/*' app.jar` \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output jdk
FROM alpine:3.14
ARG BUILD_PATH=/opt/build
ENV JAVA_HOME=/opt/jdk
ENV PATH "${JAVA_HOME}/bin:${PATH}"
RUN addgroup nonrootgroup; adduser --ingroup nonrootgroup --disabled-password nonroot
USER nonroot
WORKDIR /opt/workspace
COPY migrations ./data/migrations
COPY prometheus.yml ./data
COPY --from=build $BUILD_PATH/jdk $JAVA_HOME
COPY --from=build $BUILD_PATH/spring-boot-loader/ ./
COPY --from=build $BUILD_PATH/dependencies/ ./
COPY --from=build $BUILD_PATH/application/ ./
ENV DATABASE_ACCESS_TYPE=jdbc
ENV DELAY_TYPE=fixed
ENV USE_QUEUE=false
ENV SPRING_DATASOURCE_DB=scrapper
ENV SPRING_DATASOURCE_USERNAME=postgres
ENV SPRING_DATASOURCE_PASSWORD=postgres
EXPOSE 8080 8081
VOLUME ["/opt/workspace/data"]
ENTRYPOINT ["java", "-Dspring.profiles.active=docker", "org.springframework.boot.loader.launch.JarLauncher"]