修改cnb
This commit is contained in:
parent
581bd96a4d
commit
bdca509371
16
.cnb.yml
16
.cnb.yml
@ -1,10 +1,8 @@
|
||||
main:
|
||||
push:
|
||||
- services:
|
||||
$:
|
||||
vscode:
|
||||
- docker:
|
||||
# 指定云原生开发启动时的基础镜像为当前镜像
|
||||
image: docker.cnb.cool/dockermen/tenantdrive
|
||||
services:
|
||||
- vscode
|
||||
- docker
|
||||
stages:
|
||||
# 同名镜像构建&推送
|
||||
- name: docker build
|
||||
script: docker build -t ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest .
|
||||
- name: docker push
|
||||
script: docker push ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest
|
||||
|
@ -1,5 +1,5 @@
|
||||
# .ide/Dockerfile
|
||||
FROM python:3.8
|
||||
FROM python:3.13
|
||||
|
||||
# 安装 code-server 和扩展(使用 id 安装 python 扩展,使用 vsix 安装包安装 pylance 扩展)
|
||||
RUN curl -fsSL https://code-server.dev/install.sh | sh \
|
||||
|
8
index.html
Normal file
8
index.html
Normal file
@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<title> Hello World </title>
|
||||
</head>
|
||||
<body>
|
||||
<h1> Hello World </h1>
|
||||
</body>
|
||||
</html>
|
21
main.py
Normal file
21
main.py
Normal file
@ -0,0 +1,21 @@
|
||||
import os
|
||||
import requests
|
||||
from flask import Flask, render_template, request, redirect, url_for, session
|
||||
|
||||
app = Flask(__name__)
|
||||
app.secret_key = os.urandom(24)
|
||||
app.config["SESSION_TYPE"] = "filesystem"
|
||||
app.config["SESSION_FILE_DIR"] = "./.flask_session/"
|
||||
app.config["SESSION_PERMANENT"] = False
|
||||
app.config["SESSION_COOKIE_NAME"] = "login"
|
||||
app.config["SESSION_COOKIE_HTTPONLY"] = True
|
||||
app.config["SESSION_COOKIE_SECURE"] = False
|
||||
|
||||
|
||||
@app.route("/", methods=["GET", "POST"])
|
||||
def index():
|
||||
if request.method == "POST":
|
||||
session["username"] = request.form["username"]
|
||||
session["password"] = request.form["password"]
|
||||
return redirect(url_for("home"))
|
||||
return render_template("index.html")
|
Loading…
x
Reference in New Issue
Block a user