tes
This commit is contained in:
49
docker/shulker/Dockerfile
Normal file
49
docker/shulker/Dockerfile
Normal file
@@ -0,0 +1,49 @@
|
||||
# Build Shulker without modifying the submodule; run as non-root; persist config and read logs via volumes
|
||||
FROM node:22-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Enable corepack so yarn is available (Node 18+)
|
||||
RUN corepack enable
|
||||
|
||||
# Copy only dependency manifests first for better layer caching
|
||||
COPY external/shulker/package.json external/shulker/yarn.lock ./external/shulker/
|
||||
|
||||
WORKDIR /app/external/shulker
|
||||
|
||||
# Install dependencies
|
||||
RUN yarn install --frozen-lockfile || yarn install
|
||||
|
||||
# Copy source and build
|
||||
COPY external/shulker/ /app/external/shulker/
|
||||
RUN yarn build
|
||||
|
||||
FROM node:22-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy built app from builder
|
||||
COPY --from=build /app/external/shulker /app
|
||||
|
||||
# Prepare runtime directories and non-root user
|
||||
RUN adduser -D -h /app -u 10001 shulker \
|
||||
&& mkdir -p /data /minecraft/logs \
|
||||
&& chown -R shulker:shulker /app /data /minecraft
|
||||
|
||||
# Copy entrypoint
|
||||
COPY docker/shulker/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
# Install helpful runtime tools
|
||||
RUN apk add --no-cache jq
|
||||
|
||||
USER shulker
|
||||
|
||||
# Shulker default port
|
||||
EXPOSE 8000
|
||||
|
||||
# Volumes: /data holds config.json, /minecraft/logs maps to the server logs
|
||||
VOLUME ["/data", "/minecraft/logs"]
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["node", "build/index.js"]
|
||||
Reference in New Issue
Block a user