hijnu commited on
Commit
0529ca6
·
verified ·
1 Parent(s): f7d9b26

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +48 -0
Dockerfile ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nocodb/nocodb:latest
2
+
3
+ ARG NC_S3_REGION
4
+ ARG NC_S3_ENDPOINT
5
+ ARG NC_S3_ACCESS_KEY
6
+
7
+ RUN apk add --no-cache git \
8
+ && git clone https://github.com/aigem/hf-nocodb.git /tmp/hf-nocodb \
9
+ && cp /tmp/hf-nocodb/src/* /tmp/ \
10
+ && rm -rf /tmp/hf-nocodb
11
+
12
+ COPY /tmp/setup.sh /tmp/s3_setup.sh /tmp/
13
+ COPY /tmp/startup.sh /usr/src/appEntry/startup.sh
14
+
15
+ RUN --mount=type=secret,id=NC_S3_BUCKET_NAME,mode=0444,required=true \
16
+ --mount=type=secret,id=NC_S3_ACCESS_SECRET,mode=0444,required=true \
17
+ /tmp/setup.sh && \
18
+ chmod +x /usr/src/appEntry/startup.sh && \
19
+ /tmp/s3_setup.sh && \
20
+ rm /tmp/setup.sh /tmp/s3_setup.sh
21
+
22
+ USER nocodb
23
+
24
+ WORKDIR /usr/src/app
25
+
26
+ # 设置环境变量
27
+ ENV LITESTREAM_S3_SKIP_VERIFY=false \
28
+ LITESTREAM_RETENTION=1440h \
29
+ LITESTREAM_RETENTION_CHECK_INTERVAL=72h \
30
+ LITESTREAM_SNAPSHOT_INTERVAL=24h \
31
+ LITESTREAM_SYNC_INTERVAL=60s \
32
+ NC_DOCKER=0.6 \
33
+ NC_TOOL_DIR=/usr/app/data/ \
34
+ NODE_ENV=production \
35
+ PORT=7860 \
36
+ NC_ALLOW_LOCAL_HOOKS=true \
37
+ NC_REDIS_URL="redis://:redis_password@localhost:6379/4" \
38
+ NC_S3_REGION=${NC_S3_REGION} \
39
+ NC_S3_ENDPOINT=${NC_S3_ENDPOINT} \
40
+ NC_S3_ACCESS_KEY=${NC_S3_ACCESS_KEY} \
41
+ LITESTREAM_S3_REGION=${NC_S3_REGION} \
42
+ LITESTREAM_S3_ENDPOINT=${NC_S3_ENDPOINT} \
43
+ LITESTREAM_S3_ACCESS_KEY_ID=${NC_S3_ACCESS_KEY}
44
+
45
+ ENV $(source /etc/profile.d/s3_env.sh && env | grep '^S3_' | xargs)
46
+
47
+ ENTRYPOINT ["/usr/bin/dumb-init", "--"]
48
+ CMD ["/usr/src/appEntry/startup.sh"]