Skip to content

Commit

Permalink
docker: remove browser and xpra
Browse files Browse the repository at this point in the history
  • Loading branch information
lss233 committed Feb 3, 2023
1 parent ee67b63 commit ca69d72
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
28 changes: 1 addition & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,9 @@ WORKDIR /app

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt install software-properties-common apt-transport-https wget ca-certificates gnupg2 -yq && \
wget -qO /usr/share/keyrings/xpra-2022.gpg https://xpra.org/xpra-2022.gpg && \
echo deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/xpra-2022.gpg] https://xpra.org/ bullseye main | tee /etc/apt/sources.list.d/xpra.list && \
wget -O- /usr/share/keyrings/google-chrome.gpg https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor --yes -o /usr/share/keyrings/google-chrome.gpg && \
echo deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main | tee -a /etc/apt/sources.list.d/google-chrome.list && \
apt-get update && \
apt install --no-install-recommends xpra xvfb libgl1-mesa-dri xauth google-chrome-stable xterm -yq


RUN set -eux; \
apt-get clean; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*

COPY requirements.txt /app
RUN pip install -r requirements.txt

COPY . /app

# Copy xpra config file
COPY ./docker/xpra.conf /etc/xpra/xpra.conf

# Set default xpra password
ENV XPRA_PASSWORD password

# Expose xpra HTML5 client port
EXPOSE 14500

CMD ["/bin/bash", "/app/docker/start.sh"]

RUN ln -sf /proc/1/fd/1 /tmp/log.txt
CMD ["/bin/bash", "/app/docker/start.sh"]
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ services:
restart: always
environment:
LANG: 'C.UTF-8'
XPRA_PASSWORD: 'lss233' # XPRA 密码,建议修改
ports:
- 14500:14500
volumes:
- ./config.json:/app/config.json
# - ./fonts:/app/fonts # 如果你想自定义字体,就解除注释
# - ./presets:/app/presets # 如果你想自定义预设,就解除注释
2 changes: 1 addition & 1 deletion docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

cd /app
xpra start --no-daemon --html=on --start-child="xterm -e 'python bot.py 2>&1 | tee /tmp/log.txt'" --exit-with-children
python bot.py

0 comments on commit ca69d72

Please sign in to comment.