瀏覽代碼

chore(demo): update dockerfile

Jacky 1 年之前
父節點
當前提交
ee30e840e3
共有 2 個文件被更改,包括 16 次插入10 次删除
  1. 12 6
      demo.Dockerfile
  2. 4 4
      resources/demo/app.ini

+ 12 - 6
demo.Dockerfile

@@ -9,11 +9,17 @@ EXPOSE 80
 COPY resources/demo/ojbk.me /etc/nginx/sites-available/ojbk.me
 COPY resources/demo/app.ini /etc/nginx-ui/app.ini
 COPY resources/demo/demo.db /etc/nginx-ui/database.db
-COPY resources/docker/nginx.conf /etc/nginx/nginx.conf
-COPY resources/docker/nginx-ui.conf /etc/nginx/conf.d/nginx-ui.conf
-COPY resources/docker/start.sh /app/start.sh
-COPY nginx-ui-$TARGETOS-$TARGETARCH$TARGETVARIANT/nginx-ui /app/nginx-ui
 
-RUN cd /app && chmod a+x start.sh && rm -f /etc/nginx/conf.d/default.conf
+# register nginx-ui service
+COPY resources/docker/nginx-ui.run /etc/s6-overlay/s6-rc.d/nginx-ui/run
+RUN echo 'longrun' > /etc/s6-overlay/s6-rc.d/nginx-ui/type && \
+    touch /etc/s6-overlay/s6-rc.d/user/contents.d/nginx-ui
 
-ENTRYPOINT ["./start.sh"]
+# copy nginx config
+COPY resources/docker/nginx.conf /usr/local/etc/nginx/nginx.conf
+COPY resources/docker/nginx-ui.conf /usr/local/etc/nginx/conf.d/nginx-ui.conf
+
+# copy nginx-ui executable binary
+COPY nginx-ui-$TARGETOS-$TARGETARCH$TARGETVARIANT/nginx-ui /usr/local/bin/nginx-ui
+
+RUN rm -f /etc/nginx/conf.d/default.conf

+ 4 - 4
resources/demo/app.ini

@@ -1,16 +1,16 @@
 [server]
 HttpPort = 9000
 RunMode = release
-JwtSecret = 2E1CE615-BB15-44F5-B5BE-6B5DA3581D0F
+JwtSecret = 6EEB622E-5C73-4082-AF76-7BAC337772F2
 Email = test@jackyu.cn
 HTTPChallengePort = 9180
 StartCmd = bash
-NodeSecret = fdc7764f-92d2-454c-9640-6a09be121139
+NodeSecret = 57D079F2-CA8B-412A-B5C0-FDA291C13391
 Demo = true
 
 [nginx]
-AccessLogPath = /var/log/nginx/access.local.log
-ErrorLogPath = /var/log/nginx/error.local.log
+AccessLogPath =
+ErrorLogPath =
 
 [openai]
 Model   = gpt-3.5-turbo