-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (28 loc) · 1.27 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
# Fetch specified binary from Alexis repository.
FROM alpine:3.12.0 AS build
# The location to download and extract Alexis (Discord) from.
ARG LOCATION="https://gitlab.com/Elypia/alexis/-/jobs/609086271/artifacts/download"
# Environment variables set to ensure consistency in names.
ENV ARCHIVE_NAME="alexis.zip"
# We'll move builds from here to the next image.
WORKDIR /home/dev/
# Download and Extract Alexis
RUN echo "Downloading and extracting Alexis locally" && \
wget --output-document ${ARCHIVE_NAME} ${LOCATION} && \
unzip ${ARCHIVE_NAME} && \
echo "Delete zip archive of Alexis before continuing" && \
rm ${ARCHIVE_NAME}
# Smallest appropriate image.
FROM openjdk:11.0.7-jre-slim
LABEL maintainer="seth@elypia.org"
RUN echo "Adding alexis system group and user" && \
groupadd --system --gid 1000 alexis && \
useradd --system --create-home --gid alexis --uid 1000 --shell /bin/bash alexis
USER alexis
WORKDIR /home/alexis/
# Copy over the application from the build image; it's just a single jar file.
COPY --from=build /home/dev/discord/build/libs/* /home/alexis/
ENV org.apache.deltaspike.ProjectStage=Production
# On startup, execute the jar.
ENTRYPOINT ["java", "-jar", "./alexis-discord.jar"]
# Check the README.md to find our how to configure the image.