f
File size: 2,020 Bytes
12b9daa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c1c689a
12b9daa
c1c689a
 
03a73a0
 
 
 
12b9daa
 
 
 
2af0d45
27f8cfc
 
03a73a0
c1c689a
03a73a0
12b9daa
 
 
 
 
 
 
 
 
 
2c6576f
 
 
 
 
 
 
 
 
 
12b9daa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# 使用 denoland/deno:debian 作为基础镜像
FROM denoland/deno:debian

# 设置环境变量
ENV DEBIAN_FRONTEND=noninteractive

# 更新包列表并安装必要的工具
RUN apt-get update && \
    apt-get install -y \
    curl \
    wget \
    git \
    build-essential \
    libssl-dev \
    libffi-dev \
    python3 \
    python3-pip \
    python3-venv \
    nodejs \
    npm \
    clang \
    libclang-dev \
    cmake


# 安装最新版本的 Python 并确保在 /usr/local/bin/python3
RUN ln -s /usr/bin/python3 /usr/local/bin/python3
RUN ln -s /usr/bin/pip3 /usr/local/bin/pip3
RUN /usr/local/bin/python3 -m pip config set global.break-system-packages true

RUN /usr/local/bin/python3 -m pip install pip-tools
RUN npm install -g bun
RUN ln -s /usr/local/bin/bun /usr/bin/bun

# 安装最新版本的 Go 并确保在 /usr/bin/go
RUN wget https://golang.org/dl/go1.18.3.linux-amd64.tar.gz -O /tmp/golang.tar.gz && \
    tar -C /usr/local -xzf /tmp/golang.tar.gz && \
    rm /tmp/golang.tar.gz
RUN ln -s /usr/local/go/bin/go /usr/bin/go

# 设置 Go 的环境变量
ENV PATH="/usr/local/go/bin:${PATH}"

# 创建配置文件和数据目录
RUN mkdir -p /etc/windmill /var/lib/windmill /.cache
RUN chown -R 1000:1000 /.cache

# 创建用户和组 (UID 1000, GID 1000)
RUN groupadd -g 1000 myuser && \
    useradd -u 1000 -g myuser -m -s /bin/bash myuser

USER myuser
WORKDIR /home/myuser

# 下载 Windmill 二进制文件
RUN LATEST_RELEASE=$(curl -s https://api.github.com/repos/windmill-labs/windmill/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}') && \
    wget https://github.com/windmill-labs/windmill/releases/download/${LATEST_RELEASE}/windmill-amd64 -O windmill && \
    chmod +x windmill

# 配置环境变量
ENV DATABASE_URL="postgresql://user:password@localhost:5432/windmill"
ENV BASE_URL="http://localhost:8000"
ENV MODE="standalone"
ENV SCRIPT_TOKEN_EXPIRY="900"

# 暴露 Windmill 的端口
EXPOSE 8000

# 运行 Windmill
CMD ["./windmill", "--mode", "standalone"]