mirror of
https://github.com/kingmo888/rustdesk-api-server.git
synced 2026-02-21 10:27:23 +08:00
优化docker构建
缩减50%镜像体积,为自动构建铺垫
This commit is contained in:
parent
82d731a83d
commit
3cb7105d0d
25
Dockerfile
25
Dockerfile
@ -1,27 +1,18 @@
|
||||
FROM python:3.10.3-slim-bullseye
|
||||
FROM python:3.10.3-alpine
|
||||
|
||||
WORKDIR /rustdesk-api-server
|
||||
ADD . /rustdesk-api-server
|
||||
|
||||
RUN pip install pip -U -i https://mirrors.cloud.tencent.com/pypi/simple
|
||||
RUN pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple
|
||||
RUN pip config set install.trusted-host mirrors.cloud.tencent.com
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
VOLUME /rustdesk-api-server/db.sqlite3
|
||||
|
||||
ENV HOST 0.0.0.0
|
||||
ENV TZ=Asia/Shanghai \
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
RUN set -ex \
|
||||
&& pip install --no-cache-dir --disable-pip-version-check -r requirements.txt \
|
||||
&& rm -rf /var/cache/apk/* \
|
||||
&& cp -r ./db ./db_bak
|
||||
|
||||
ENV HOST=0.0.0.0
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV CSRF_TRUSTED_ORIGINS=""
|
||||
|
||||
|
||||
EXPOSE 21114/tcp
|
||||
EXPOSE 21114/udp
|
||||
|
||||
RUN cd /rustdesk-api-server
|
||||
|
||||
|
||||
ENTRYPOINT ["bash", "run.sh"]
|
||||
|
||||
ENTRYPOINT ["sh", "run.sh"]
|
||||
|
||||
@ -7,10 +7,12 @@ services:
|
||||
environment:
|
||||
- HOST=0.0.0.0
|
||||
- TZ=Asia/Shanghai
|
||||
- CSRF_TRUSTED_ORIGINS=<//域名:端口>
|
||||
- CSRF_TRUSTED_ORIGINS=http://yourdomain.com:21114
|
||||
volumes:
|
||||
- ./db.sqlite3:/rustdesk-api-server/db.sqlite3
|
||||
- /yourpath/db:/rustdesk-api-server/db
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
network_mode: bridge
|
||||
ports:
|
||||
- "21114:21114"
|
||||
restart: unless-stopped
|
||||
|
||||
Loading…
Reference in New Issue
Block a user