mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-18 17:15:13 +01:00
Rework rebased Dockerfile for an attempt at userns
This commit is contained in:
parent
a488802847
commit
0de6948b4c
39
Dockerfile
39
Dockerfile
@ -7,18 +7,39 @@ LABEL maintainer="Dockerfile created by Zedifus <https://gitlab.com/zedifus>"
|
|||||||
# Security Patch for CVE-2021-44228
|
# Security Patch for CVE-2021-44228
|
||||||
ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
|
ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
|
||||||
|
|
||||||
# Install Packages And Dependencies
|
# Install Packages, Dependencies and Setup user
|
||||||
COPY requirements.txt /commander/requirements.txt
|
COPY requirements.txt /commander-venv/requirements.txt
|
||||||
RUN apt update \
|
RUN groupadd -g "${PGID:-0}" -o crafty \
|
||||||
&& apt install -y gcc python3 python3-pip libmariadb-dev openjdk-8-jre-headless openjdk-11-jre-headless openjdk-16-jre-headless openjdk-17-jre-headless default-jre \
|
&& useradd -g "${PGID:-0}" -u "${PUID:-0}" -o crafty \
|
||||||
&& pip3 install --no-cache-dir -r /commander/requirements.txt
|
&& 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 \
|
||||||
|
&& pip3 install --no-cache-dir --upgrade setuptools==50.3.2 pip==20.3.3 \
|
||||||
|
&& pip3 install --no-cache-dir -r /commander-venv/requirements.txt \
|
||||||
|
&& deactivate \
|
||||||
|
&& chown -R crafty:crafty /commander-venv
|
||||||
|
|
||||||
# Copy Source & copy default config from image
|
# Copy Source & copy default config from image
|
||||||
COPY ./ /commander
|
COPY ./ /commander
|
||||||
WORKDIR /commander
|
WORKDIR /commander
|
||||||
RUN mv ./app/config ./app/config_original \
|
RUN mv ./app/config ./app/config_original \
|
||||||
&& mv ./app/config_original/default.json.example ./app/config_original/default.json \
|
&& mv ./app/config_original/default.json.example ./app/config_original/default.json \
|
||||||
&& chmod +x ./docker_launcher.sh
|
&& chown -R crafty:crafty /commander \
|
||||||
|
&& chmod +x ./docker_launcher.sh
|
||||||
|
|
||||||
# Expose Web Interface port & Server port range
|
# Expose Web Interface port & Server port range
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
@ -26,6 +47,8 @@ EXPOSE 8443
|
|||||||
EXPOSE 19132
|
EXPOSE 19132
|
||||||
EXPOSE 25500-25600
|
EXPOSE 25500-25600
|
||||||
|
|
||||||
# Start Crafty Commander through wrapper
|
# Start Crafty Commander through wrapper as crafty
|
||||||
|
USER crafty
|
||||||
ENTRYPOINT ["/commander/docker_launcher.sh"]
|
ENTRYPOINT ["/commander/docker_launcher.sh"]
|
||||||
CMD ["-v", "-d", "-i"]
|
CMD ["-v", "-d", "-i"]
|
||||||
|
|
||||||
|
@ -6,4 +6,6 @@ if [ ! "$(ls -A ./app/config)" ]; then
|
|||||||
cp -r ./app/config_original/* ./app/config/
|
cp -r ./app/config_original/* ./app/config/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Activate our prepared venv and launch crafty with provided args
|
||||||
|
. /commander-venv/bin/activate
|
||||||
exec python3 main.py $@
|
exec python3 main.py $@
|
||||||
|
Loading…
x
Reference in New Issue
Block a user