crafty-4/Dockerfile

55 lines
1.6 KiB
Docker
Raw Normal View History

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>"
# Security Patch for CVE-2021-44228
ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
2022-03-01 20:14:53 +00:00
# Install Packages and Setup Dependencies in venv
COPY requirements.txt /commander-venv/requirements.txt
2022-03-01 20:14:53 +00:00
RUN apt-get update \
&& apt-get -y --no-install-recommends install \
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 \
&& apt-get clean \
&& python3 -m venv /commander-venv/ \
&& . /commander-venv/bin/activate \
2022-02-27 21:25:44 +00:00
&& pip3 install --no-cache-dir --upgrade setuptools==50.3.2 pip==22.0.3 \
&& pip3 install --no-cache-dir -r /commander-venv/requirements.txt \
2022-03-01 20:14:53 +00:00
&& deactivate
2021-08-26 02:47:56 +00:00
2022-03-01 20:14:53 +00:00
# Copy Source and prepare config if needed, Then apply permissions.
2021-08-26 02:47:56 +00:00
COPY ./ /commander
WORKDIR /commander
RUN mv ./app/config ./app/config_original \
&& mv ./app/config_original/default.json.example ./app/config_original/default.json \
2022-03-01 20:14:53 +00:00
&& chown -R 1001:0 /commander /commander-venv \
&& chmod -R g=u /commander /commander-venv \
&& chmod +x ./docker_launcher.sh \
&& chmod 775 /commander /commander-venv
# Switch user to non-root
USER 1001
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-01 20:14:53 +00:00
# Start Crafty Commander through wrapper
2021-08-26 02:47:56 +00:00
ENTRYPOINT ["/commander/docker_launcher.sh"]
CMD ["-v", "-d", "-i"]