-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
74 lines (56 loc) · 1.88 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
68
69
70
71
72
73
74
###################
# 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:x86_64-debianslim-jre8u345-b01 as builder
WORKDIR /app/source
ENV FC_LANG en-US
ENV LC_CTYPE en_US.UTF-8
# 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/openjdk8:x86_64-debianslim-jre8u345-b01 as runner
LABEL org.opencontainers.image.source https://github.com/rapex-lab/rapex
ENV PATH="$PATH:/app/bin"
ENV PYTHONDONTWRITEBYTECODE=1
ENV FC_LANG en-US
ENV LC_CTYPE en_US.UTF-8
WORKDIR /app
RUN echo "**** Install dev packages ****" && \
apt-get update && \
apt-get install -y bash wget git curl r-base python3 python3-pip && \
\
echo "*** Install common development dependencies" && \
apt-get install -y libmariadb-dev python3-dev libxml2-dev libcurl4-openssl-dev libssl-dev && \
\
echo "**** Install R development dependencies ****" && \
Rscript -e 'install.packages("renv")' && \
\
echo "**** Cleanup ****" && \
apt-get clean
# Add rapex script and uberjar
RUN mkdir -p bin target/uberjar
COPY --from=builder /app/source/target/uberjar/rapex.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"]