File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,16 @@ RUN uv venv --python python3.11 .venv && \
4141 uv pip install .[dev]
4242ENV PATH="/app/.venv/bin:${PATH}"
4343
44- # 8. Copy Remaining Project Code (Optional)
44+ # 8. Copy Xvfb script
45+ COPY --chown=devuser:devuser docker/run_with_xvfb.sh /usr/local/bin/
46+
47+ # 9. Copy Remaining Project Code (Optional)
4548# For development, the rest of the code is typically mounted.
4649# If building an image for deployment, you would uncomment the following:
4750COPY --chown=devuser:devuser . .
4851
52+ # Set the entrypoint to use Xvfb
53+ ENTRYPOINT ["/usr/local/bin/run_with_xvfb.sh" ]
54+
4955# Default command (can be overridden in docker-compose.yml or docker run)
5056# CMD ["python", "src/main.py"]
Original file line number Diff line number Diff line change @@ -14,9 +14,12 @@ services:
1414 tty : true
1515 stdin_open : true
1616 environment :
17- - DISPLAY=${DISPLAY}
17+ - DISPLAY=host.docker.internal:0
18+ # 以下はXvfbを使用する場合のみ有効
19+ # - DISPLAY=:99
1820 # - QT_X11_NO_MITSHM=1
1921 # - WAYLAND_DISPLAY=${WAYLAND_DISPLAY}
22+ command : bash
2023# Named volume for bash history persistence
2124volumes :
2225 dev_bash_history :
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # Start Xvfb in the background
3+ Xvfb :99 -screen 0 1024x768x24 -ac &
4+ # Export the display
5+ export DISPLAY=:99
6+ # Execute the command passed to this script
7+ exec " $@ "
You can’t perform that action at this time.
0 commit comments