-
-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (30 loc) · 1.48 KB
/
Dockerfile
File metadata and controls
41 lines (30 loc) · 1.48 KB
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
FROM eclipse-temurin:25-jre AS soulfire-runner
ARG VERSION
# Setup groups and install dumb init
RUN groupadd --gid 1001 soulfire && \
useradd --home-dir /soulfire --uid 1001 --gid soulfire --create-home soulfire && \
apt-get update && apt-get install -y --no-install-recommends dumb-init curl && \
rm -rf /var/lib/apt/lists/* && \
chmod 755 /soulfire
# Download JAR from GitHub releases
ADD --chown=soulfire:soulfire https://github.com/soulfiremc-com/SoulFire/releases/download/${VERSION}/SoulFireDedicated-${VERSION}.jar /soulfire/soulfire.jar
RUN chmod 644 /soulfire/soulfire.jar
# Use the soulfire's home directory as our work directory
WORKDIR /soulfire/data
# Copy over the start script
COPY --chmod=755 start.sh /soulfire/start.sh
# Ensure runtime data directory is writable when mounted or initialized
RUN mkdir -p /soulfire/data && chown -R soulfire:soulfire /soulfire
# Switch from root to soulfire
USER soulfire
EXPOSE 38765/tcp
LABEL org.opencontainers.image.source="https://github.com/soulfiremc-com/SoulFire" \
org.opencontainers.image.description="SoulFire Dedicated Server" \
org.opencontainers.image.licenses="AGPL-3.0-only" \
org.opencontainers.image.title="SoulFire" \
org.opencontainers.image.vendor="AlexProgrammerDE"
HEALTHCHECK --interval=30s --timeout=10s --retries=5 \
CMD curl -f http://localhost:38765/health || exit 1
# Start the process using dumb-init
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/bin/bash", "/soulfire/start.sh"]