2022-02-27 01:54:07 +00:00
|
|
|
FROM ubuntu:20.04
|
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND="noninteractive"
|
2021-08-26 02:47:56 +00:00
|
|
|
|
|
|
|
LABEL maintainer="Dockerfile created by Zedifus <https://gitlab.com/zedifus>"
|
|
|
|
|
2021-12-12 15:17:22 +00:00
|
|
|
# Security Patch for CVE-2021-44228
|
|
|
|
ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
|
|
|
|
|
2022-03-02 05:16:45 +00:00
|
|
|
# Create non-root user & required dirs
|
2022-03-07 01:51:25 +00:00
|
|
|
RUN useradd -g root -M crafty \
|
2022-03-02 05:16:45 +00:00
|
|
|
&& mkdir /commander \
|
|
|
|
&& chown -R crafty:root /commander
|
|
|
|
|
|
|
|
# Install required system packages
|
|
|
|
RUN apt-get update \
|
2022-02-27 18:38:30 +00:00
|
|
|
&& apt-get -y --no-install-recommends install \
|
2022-03-07 01:51:25 +00:00
|
|
|
sudo \
|
2022-02-27 18:38:30 +00:00
|
|
|
gcc \
|
|
|
|
python3 \
|
|
|
|
python3-dev \
|
|
|
|
python3-pip \
|
|
|
|
python3-venv \
|
|
|
|
libmariadb-dev \
|
|
|
|
default-jre \
|
|
|
|
openjdk-8-jre-headless \
|
|
|
|
openjdk-11-jre-headless \
|
|
|
|
openjdk-16-jre-headless \
|
|
|
|
openjdk-17-jre-headless \
|
|
|
|
&& apt-get autoremove \
|
2022-03-02 05:16:45 +00:00
|
|
|
&& apt-get clean
|
2021-08-26 02:47:56 +00:00
|
|
|
|
2022-03-02 05:16:45 +00:00
|
|
|
# Switch to service user for installing crafty deps
|
|
|
|
USER crafty
|
2021-08-26 02:47:56 +00:00
|
|
|
WORKDIR /commander
|
2022-03-02 05:16:45 +00:00
|
|
|
COPY --chown=crafty:root requirements.txt ./
|
|
|
|
RUN python3 -m venv ./.venv \
|
|
|
|
&& . .venv/bin/activate \
|
|
|
|
&& pip3 install --no-cache-dir --upgrade setuptools==50.3.2 pip==22.0.3 \
|
|
|
|
&& pip3 install --no-cache-dir -r requirements.txt \
|
|
|
|
&& deactivate
|
2022-03-07 01:51:25 +00:00
|
|
|
USER root
|
2022-03-02 05:16:45 +00:00
|
|
|
|
|
|
|
# Copy Source w/ perms & prepare default config from example
|
|
|
|
COPY --chown=crafty:root ./ ./
|
2021-08-26 02:47:56 +00:00
|
|
|
RUN mv ./app/config ./app/config_original \
|
2022-02-27 18:38:30 +00:00
|
|
|
&& mv ./app/config_original/default.json.example ./app/config_original/default.json \
|
2022-03-01 20:20:17 +00:00
|
|
|
&& chmod +x ./docker_launcher.sh
|
2021-08-26 02:47:56 +00:00
|
|
|
|
|
|
|
# Expose Web Interface port & Server port range
|
|
|
|
EXPOSE 8000
|
|
|
|
EXPOSE 8443
|
|
|
|
EXPOSE 19132
|
|
|
|
EXPOSE 25500-25600
|
|
|
|
|
2022-03-02 05:16:45 +00:00
|
|
|
# Start Crafty Commander through wrapper
|
2021-08-26 02:47:56 +00:00
|
|
|
ENTRYPOINT ["/commander/docker_launcher.sh"]
|
|
|
|
CMD ["-v", "-d", "-i"]
|