This website works better with JavaScript.
首頁
探索
說明
登入
sindre
/
Beelance
關註
1
收藏
0
複製
0
程式碼
問題管理
6
合併請求
0
版本發佈
0
Wiki
Activity
瀏覽代碼
Correctly use env variable to connect to database after image is running
https
jakobsn
6 年之前
父節點
8cedf0d58f
當前提交
3bb08a973f
共有
3 個文件被更改
,包括
3 次插入
和
2 次删除
分割檢視
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
.env
+1
-0
src/Dockerfile
+1
-1
src/app/models/database.py
+ 1
- 1
.env
查看文件
@@ -1 +1 @@
groupid=
9
0
groupid=0
9
+ 1
- 0
src/Dockerfile
查看文件
@@ -6,6 +6,7 @@ EXPOSE 8080
# Define environment
COPY ./app /app
RUN echo ${groupid} > /app/models/.env
WORKDIR /app
ENV PYTHONPATH=/app
+ 1
- 1
src/app/models/database.py
查看文件
@@ -2,7 +2,7 @@ import mysql.connector
from dotenv import load_dotenv
import os
groupid = os.getenv("groupid")
groupid = os.getenv("groupid")
.lstrip("0")
"""
Connect the webserver to the database using the python mysql connecter.
Write
Preview
Loading…
取消
儲存