Add docker support
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
parent
8c8bda8d59
commit
0b3cddc09d
|
@ -0,0 +1,37 @@
|
|||
FROM alpine:latest AS base-builder
|
||||
ARG SBT_VERSION=1.3.13
|
||||
RUN apk add --no-cache bash
|
||||
ENV JAVA_HOME="/usr/lib/jvm/default-jvm/"
|
||||
RUN apk add openjdk11-jre
|
||||
ENV PATH=$PATH:${JAVA_HOME}/bin
|
||||
RUN \
|
||||
wget -O sbt-$SBT_VERSION.tgz https://github.com/sbt/sbt/releases/download/v$SBT_VERSION/sbt-$SBT_VERSION.tgz && \
|
||||
tar -xzvf sbt-$SBT_VERSION.tgz && \
|
||||
rm sbt-$SBT_VERSION.tgz
|
||||
|
||||
ENV PATH=$PATH:/sbt/bin/
|
||||
|
||||
|
||||
FROM base-builder AS builder
|
||||
WORKDIR /build
|
||||
COPY lib/ lib/
|
||||
COPY project/plugins.sbt project/
|
||||
COPY build.sbt .
|
||||
COPY src/ src/
|
||||
RUN sbt assembly
|
||||
|
||||
|
||||
FROM alpine:latest AS base-core
|
||||
ENV JAVA_HOME="/usr/lib/jvm/default-jvm/"
|
||||
RUN apk add openjdk11-jre
|
||||
ENV PATH=$PATH:${JAVA_HOME}/bin
|
||||
|
||||
|
||||
FROM base-core
|
||||
WORKDIR /lc-core
|
||||
COPY --from=builder /build/target/scala-2.13/LibreCaptcha.jar .
|
||||
RUN mkdir data/
|
||||
|
||||
EXPOSE 8888
|
||||
|
||||
CMD [ "java", "-jar", "LibreCaptcha.jar" ]
|
|
@ -0,0 +1,11 @@
|
|||
version: "3.8"
|
||||
|
||||
services:
|
||||
lc-core:
|
||||
container_name: "libre-captcha"
|
||||
build: ./
|
||||
image: librecapthca/lc-core:latest
|
||||
volumes:
|
||||
- "./docker-data:/lc-core/data"
|
||||
ports:
|
||||
- "8888:8888"
|
Loading…
Reference in New Issue