29 lines
863 B
Django/Jinja
29 lines
863 B
Django/Jinja
# Custom Minecraft Server Containerfile
|
|
# Deployed by Ansible - only used if minecraft.use_custom_container is true
|
|
|
|
# Base image
|
|
FROM itzg/minecraft-server:java{{ minecraft.java_version | default('21') }}
|
|
|
|
# Custom server type
|
|
ENV TYPE={{ minecraft.server_type | upper }}
|
|
ENV VERSION={{ minecraft.version }}
|
|
|
|
# Custom plugins/mods directory (uncomment if using mods)
|
|
# VOLUME /data/mods
|
|
# VOLUME /data/plugins
|
|
# VOLUME /data/config
|
|
|
|
# Custom entrypoint overrides
|
|
COPY server.properties /tmp/server.properties
|
|
RUN mkdir -p /data && cp /tmp/server.properties /data/server.properties
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
|
|
CMD curl -f http://localhost:{{ minecraft.port }} || exit 1
|
|
|
|
# Expose ports
|
|
EXPOSE {{ minecraft.port }}/tcp
|
|
{% if minecraft.rcon_enabled %}
|
|
EXPOSE {{ minecraft.rcon_port }}/tcp
|
|
{% endif %}
|