-
Notifications
You must be signed in to change notification settings - Fork 50
/
Dockerfile
42 lines (31 loc) · 896 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
32
33
34
35
36
37
38
39
40
41
42
FROM gradle:jdk17 AS build
COPY . /cineast-src
RUN cd /cineast-src && \
gradle getExternalFiles && \
gradle shadowJar
FROM eclipse-temurin:17-jre
RUN mkdir -p /opt/cineast
COPY --from=build \
/cineast-src/cineast.json \
/opt/cineast/cineast.json
COPY --from=build \
/cineast-src/cineast-runtime/build/libs/cineast-runtime-*-all.jar \
/opt/cineast/cineast-cli.jar
COPY --from=build \
/cineast-src/cineast-api/build/libs/cineast-api-*-all.jar \
/opt/cineast/cineast-api.jar
COPY --from=build \
/cineast-src/resources \
/opt/cineast/resources
WORKDIR /opt/cineast
RUN printf '#!/bin/bash\n\
if [ "$1" != "api" ] && [ "$1" != "cli" ]; then\n\
echo "Usage: $0 api|cli" >&2\n\
exit 1\n\
fi\n\
java -jar "cineast-$1.jar" "${@:2}"'\
> /opt/cineast/bootstrap.sh
RUN chmod +x /opt/cineast/bootstrap.sh
EXPOSE 4567
EXPOSE 4568
ENTRYPOINT ["/opt/cineast/bootstrap.sh"]