Create dockerfile
Browse files- dockerfile +33 -0
dockerfile
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM nocodb/nocodb:latest
|
2 |
+
|
3 |
+
ARG CACHEBUST=1
|
4 |
+
|
5 |
+
# 设置环境变量
|
6 |
+
ENV WORKDIR=/usr/src/app \
|
7 |
+
USER=nocodb \
|
8 |
+
HOME_DIR=/home/nocodb \
|
9 |
+
PORT=7860 \
|
10 |
+
RESTORE_BACKUP=false \
|
11 |
+
|
12 |
+
RUN --mount=type=secret,id=DB_Host,mode=0444,required=true \
|
13 |
+
--mount=type=secret,id=DB_Port,mode=0444,required=true \
|
14 |
+
--mount=type=secret,id=DB_User,mode=0444,required=true \
|
15 |
+
--mount=type=secret,id=DB_Password,mode=0444,required=true \
|
16 |
+
--mount=type=secret,id=DB_Database,mode=0444,required=true \
|
17 |
+
&& git clone -b new https://github.com/aigem/hf-nocodb.git /tmp/hf-nocodb \
|
18 |
+
# 复制src下的所有文件夹及文件到/tmp/
|
19 |
+
&& cp -r /tmp/hf-nocodb/src/* /tmp/ && cp /tmp/startup.sh /usr/src/appEntry/startup.sh \
|
20 |
+
&& chmod +x /usr/src/appEntry/*.sh \
|
21 |
+
# 检查是否存在各sh文件
|
22 |
+
&& ls -l /tmp/ && ls -l /usr/src/appEntry/ \
|
23 |
+
# 安装 setup.sh
|
24 |
+
&& chmod +x /tmp/setup.sh && /tmp/setup.sh \
|
25 |
+
# 环境变量设置
|
26 |
+
&& chmod +x /tmp/env_setup.sh && /tmp/env_setup.sh
|
27 |
+
|
28 |
+
USER ${USER}
|
29 |
+
|
30 |
+
WORKDIR ${WORKDIR}
|
31 |
+
|
32 |
+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
33 |
+
CMD ["/usr/src/appEntry/startup.sh"]
|