Files
devops/docker/dev-env/Dockerfile
2025-07-12 11:07:47 +08:00

36 lines
1.0 KiB
Docker

# 基础镜像
FROM --platform=linux/amd64 ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai
# 安装常用工具 + Go + Python
RUN apt-get update && apt-get install -y \
curl wget git vim nano unzip build-essential \
python3 python3-pip \
&& rm -rf /var/lib/apt/lists/*
# 安装 Go
RUN wget https://go.dev/dl/go1.22.2.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.22.2.linux-amd64.tar.gz && \
rm go1.22.2.linux-amd64.tar.gz
# 配置 Go 环境变量
ENV PATH="/usr/local/go/bin:${PATH}"
ENV GOPATH="/root/go"
ENV PATH="${GOPATH}/bin:${PATH}"
# 创建工作目录
WORKDIR /app
# 如果需要,可以复制并安装 requirements.txt
COPY requirements.txt .
RUN pip3 install -r requirements.txt --break-system-packages || echo "no requirements.txt or already installed"
# 设置 Git 配置
RUN git config --global user.name "sophon" && \
git config --global user.email "oscar@easyprompt8.com" && \
git config --global credential.helper store
# 默认进入 bash
CMD ["/bin/bash"]