-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (49 loc) · 1.55 KB
/
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
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
###################
# STAGE 1: builder
###################
# Build currently doesn't work on > Java 11 (i18n utils are busted) so build on 8 until we fix this
FROM adoptopenjdk/openjdk8:latest as builder
WORKDIR /app/source
ENV FC_LANG en-US
ENV LC_CTYPE en_US.UTF-8
COPY sources.list /etc/apt/sources.list
# bash: various shell scripts
# wget: installing lein
# git: ./bin/version
# make: backend building
# gettext: translations
RUN apt-get update && apt-get install -y coreutils bash git wget make gettext
# lein: backend dependencies and building
ADD ./bin/lein /usr/local/bin/lein
RUN chmod 744 /usr/local/bin/lein
RUN lein upgrade
# install dependencies before adding the rest of the source to maximize caching
# backend dependencies
ADD project.clj .
RUN lein deps
# add the rest of the source
ADD . .
# build the app
RUN bin/build
# ###################
# # STAGE 2: runner
# ###################
FROM adoptopenjdk/openjdk11:jre as runner
WORKDIR /app
ENV FC_LANG en-US
ENV LC_CTYPE en_US.UTF-8
# dependencies
COPY sources.list /etc/apt/sources.list
RUN echo "**** Install dev packages ****" && \
apt-get update && \
apt-get install -y bash wget git curl libxml2-dev libcurl4-openssl-dev libssl-dev && \
echo "**** Cleanup ****" && \
apt-get clean
# add dataseq-core script and uberjar
RUN mkdir -p bin target/uberjar
COPY --from=builder /app/source/target/uberjar/dataseq-core.jar /app/target/uberjar/
COPY --from=builder /app/source/bin /app/bin/
# expose our default runtime port
EXPOSE 3000
# run it
ENTRYPOINT ["/app/bin/start"]