Refactor Dockerfile: remove redundant script and alias for .NET commands, streamline Xvfb initialization

This commit is contained in:
2025-07-07 00:31:30 +02:00
parent c7a5881445
commit e5c7731ecb

View File

@@ -92,25 +92,6 @@ RUN Xvfb :99 -screen 0 1024x768x16 & \
&& wineserver --wait \
&& kill $XVFB_PID || true
# Create a script to run .NET commands with virtual display
RUN echo '#!/bin/bash' > /home/wineuser/run-dotnet.sh \
&& echo 'export DISPLAY=:99' >> /home/wineuser/run-dotnet.sh \
&& echo 'wine dotnet "$@"' >> /home/wineuser/run-dotnet.sh \
&& chmod +x /home/wineuser/run-dotnet.sh
# Create dotnet alias and add to PATH
RUN echo 'alias dotnet="/home/wineuser/run-dotnet.sh"' >> /home/wineuser/.bashrc \
&& echo 'export PATH="/home/wineuser:$PATH"' >> /home/wineuser/.bashrc \
&& echo 'export DISPLAY=:99' >> /home/wineuser/.bashrc \
&& ln -s /home/wineuser/run-dotnet.sh /home/wineuser/dotnet
# Start Xvfb automatically when shell starts
RUN echo 'if ! pgrep Xvfb > /dev/null; then' >> /home/wineuser/.bashrc \
&& echo ' echo "Starting Xvfb display server..."' >> /home/wineuser/.bashrc \
&& echo ' Xvfb :99 -screen 0 1024x768x16 &' >> /home/wineuser/.bashrc \
&& echo ' sleep 2' >> /home/wineuser/.bashrc \
&& echo 'fi' >> /home/wineuser/.bashrc
# Set working directory for projects
WORKDIR /home/wineuser/projects