Spaces:
BG5
/
Sleeping

ssh / Dockerfile
BG5's picture
Update Dockerfile
9eafa7a verified
raw
history blame
1.41 kB
FROM python
# 设置环境变量,避免交互式配置
ARG DEBIAN_FRONTEND=noninteractive
# 设置时区为亚洲/上海
ENV TZ=Asia/Shanghai
# 设置工作目录为/app
WORKDIR /app
# 安装所需的软件包并清理APT缓存
RUN apt-get update && apt-get install -y \
wget \
tar \
unzip \
zip \
curl \
git \
sudo \
gnupg \
sqlite3 \
tzdata \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" > /etc/apt/sources.list.d/docker.list && \
apt-get update && apt-get install -y docker-ce-cli && \
curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose && \
chmod +x /usr/local/bin/docker-compose && \
apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY . .
EXPOSE 7860
CMD ["python", "app.py"]