-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
36 lines (32 loc) · 1.42 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
FROM node:16.15.0 as builder-front
WORKDIR /usr/src/app
COPY ./ergoMixFront/package.json ./
RUN npm install
COPY ./ergoMixFront ./
RUN npm run build
FROM openjdk:8u181-jdk-slim as builder
ENV DEBIAN_FRONTEND noninteractive
RUN rm /etc/apt/sources.list
RUN echo "deb http://archive.debian.org/debian-security jessie/updates main" >> /etc/apt/sources.list.d/jessie.list
RUN echo "deb http://archive.debian.org/debian jessie main" >> /etc/apt/sources.list.d/jessie.list
RUN apt-get update && \
apt-get -y --no-install-recommends --allow-unauthenticated install curl zip unzip sed
RUN curl -s "https://get.sdkman.io" | bash
RUN /bin/bash -c "source /root/.sdkman/bin/sdkman-init.sh; sdk install sbt 1.2.7"
ENV PATH=/root/.sdkman/candidates/sbt/current/bin:$PATH
WORKDIR /mixer
ADD ["./mixer", "./"]
COPY --from=builder-front /usr/src/app/build/ ./public/
RUN sbt assembly
RUN mv `find . -name ergoMixer-*.jar` /ergo-mixer.jar
CMD ["java", "-jar", "/ergo-mixer.jar"]
FROM openjdk:8-jre-slim
RUN adduser --disabled-password --home /home/ergo/ --uid 9052 --gecos "ErgoPlatform" ergo && \
install -m 0750 -o ergo -g ergo -d /home/ergo/mixer
COPY --from=builder /ergo-mixer.jar /home/ergo/ergo-mixer.jar
COPY ./mixer/conf/application.conf /home/ergo/mixer/application.conf
RUN chown ergo:ergo /home/ergo/ergo-mixer.jar
USER ergo
EXPOSE 9000
WORKDIR /home/ergo
ENTRYPOINT java -jar -D"config.file"=mixer/application.conf /home/ergo/ergo-mixer.jar