ufe commited on
Commit
2c6576f
1 Parent(s): ba70a3d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -7
Dockerfile CHANGED
@@ -34,19 +34,22 @@ RUN ln -s /usr/local/go/bin/go /usr/bin/go
34
  # 设置 Go 的环境变量
35
  ENV PATH="/usr/local/go/bin:${PATH}"
36
 
37
- # 安装 Windmill
38
- RUN mkdir -p /opt/windmill
39
- WORKDIR /opt/windmill
 
 
 
 
 
 
 
40
 
41
  # 下载 Windmill 二进制文件
42
  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)}') && \
43
  wget https://github.com/windmill-labs/windmill/releases/download/${LATEST_RELEASE}/windmill-amd64 -O windmill && \
44
  chmod +x windmill
45
 
46
- # 创建配置文件和数据目录
47
- RUN mkdir -p /etc/windmill /var/lib/windmill /.cache
48
- RUN chown -R 1000:1000 /.cache
49
-
50
  # 配置环境变量
51
  ENV DATABASE_URL="postgresql://user:password@localhost:5432/windmill"
52
  ENV BASE_URL="http://localhost:8000"
 
34
  # 设置 Go 的环境变量
35
  ENV PATH="/usr/local/go/bin:${PATH}"
36
 
37
+ # 创建配置文件和数据目录
38
+ RUN mkdir -p /etc/windmill /var/lib/windmill /.cache
39
+ RUN chown -R 1000:1000 /.cache
40
+
41
+ # 创建用户和组 (UID 1000, GID 1000)
42
+ RUN groupadd -g 1000 myuser && \
43
+ useradd -u 1000 -g myuser -m -s /bin/bash myuser
44
+
45
+ USER myuser
46
+ WORKDIR /home/myuser
47
 
48
  # 下载 Windmill 二进制文件
49
  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)}') && \
50
  wget https://github.com/windmill-labs/windmill/releases/download/${LATEST_RELEASE}/windmill-amd64 -O windmill && \
51
  chmod +x windmill
52
 
 
 
 
 
53
  # 配置环境变量
54
  ENV DATABASE_URL="postgresql://user:password@localhost:5432/windmill"
55
  ENV BASE_URL="http://localhost:8000"