-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Baiyuetribe/kamiFaka
- Loading branch information
Showing
6 changed files
with
28 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
FROM python:3.8-slim | ||
LABEL 维护者="佰阅 [email protected]" | ||
|
||
# 备选数据库Sqlite \Mysql | ||
ENV DATABASE_TYPE='Mysql' | ||
# 备选数据库Sqlite \Mysql \ PostgreSQL | ||
ENV DB_TYPE='PostgreSQL' | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY requirements.txt ./ | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY . . | ||
RUN sed -i 's#mysql:\\/\\/${MYSQL_USER}:${MYSQL_PASSWORD}@${MYSQL_HOST}:${MYSQL_PORT}\\/${MYSQL_DATABASE}#$JAWSDB_URL#g' docker-entrypoint.sh && \ | ||
sed -i 's/8000/$PORT/g' docker-entrypoint.sh && \ | ||
RUN sed -i 's|postgresql+psycopg2://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_DATABASE}|$DATABASE_URL|g' docker-entrypoint.sh && \ | ||
sed -i 's|8000|$PORT|g' docker-entrypoint.sh && \ | ||
chmod +x docker-entrypoint.sh | ||
|
||
EXPOSE $PORT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
"stack": "container", | ||
"addons": [ | ||
{ | ||
"plan": "jawsdb:kitefin" | ||
"plan": "heroku-postgresql:hobby-dev" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
build: | ||
docker: | ||
web: Heroku | ||
web: Heroku.dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,12 +49,12 @@ docker run -d \ | |
-p 8000:8000 \ | ||
--restart=always \ | ||
--name=kmfaka \ | ||
-e DATABASE_TYPE=Mysql \ | ||
-e MYSQL_HOST=数据库ip地址或容器地址"172.17.0.1" \ | ||
-e MYSQL_PORT=数据库端口 \ | ||
-e MYSQL_USER=数据库用户名 \ | ||
-e MYSQL_PASSWORD=数据库用密码 \ | ||
-e MYSQL_DATABASE=数据库名 \ | ||
-e DB_TYPE=Mysql \ | ||
-e DB_HOST=数据库ip地址或容器地址"172.17.0.1" \ | ||
-e DB_PORT=数据库端口 \ | ||
-e DB_USER=数据库用户名 \ | ||
-e DB_PASSWORD=数据库用密码 \ | ||
-e DB_DATABASE=数据库名 \ | ||
-v /opt/kamifaka:/usr/src/app/public \ | ||
baiyuetribe/kamifaka | ||
``` | ||
|
@@ -64,19 +64,19 @@ docker run -d \ | |
-p 8000:8000 \ | ||
--restart=always \ | ||
--name=kmfaka \ | ||
-e DATABASE_TYPE=Mysql \ | ||
-e MYSQL_HOST="172.17.0.1" \ | ||
-e MYSQL_PORT=3306 \ | ||
-e MYSQL_USER=faka \ | ||
-e MYSQL_PASSWORD=GxJn7ZPHwYrE366j \ | ||
-e MYSQL_DATABASE=faka \ | ||
-e DB_TYPE=Mysql \ | ||
-e DB_HOST="172.17.0.1" \ | ||
-e DB_PORT=3306 \ | ||
-e DB_USER=faka \ | ||
-e DB_PASSWORD=GxJn7ZPHwYrE366j \ | ||
-e DB_DATABASE=faka \ | ||
-v /opt/kamifaka:/usr/src/app/public \ | ||
baiyuetribe/kamifaka | ||
``` | ||
完整复制并粘贴到终端回车即可执行完毕。 | ||
然后通过ip地址加上端口号8000即可访问,后台加上`/admin`,默认管理员账号`[email protected]`,密码:`123456`。 | ||
|
||
备注:上述内容,根据`DATABASE_TYPE`指定数据库类型为Mysql,然后添加相关的数据库信息。 | ||
备注:上述内容,根据`DB_TYPE`指定数据库类型为Mysql,然后添加相关的数据库信息。 | ||
|
||
### 方法3:Heroku 无服务器部署 | ||
|
||
|