修改cnb

This commit is contained in:
dockermen 2025-04-08 13:14:01 +08:00
parent 581bd96a4d
commit bdca509371
4 changed files with 38 additions and 11 deletions

View File

@ -1,10 +1,8 @@
main: $:
push: vscode:
- services: - docker:
- docker # 指定云原生开发启动时的基础镜像为当前镜像
stages: image: docker.cnb.cool/dockermen/tenantdrive
# 同名镜像构建&推送 services:
- name: docker build - vscode
script: docker build -t ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest . - docker
- name: docker push
script: docker push ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest

View File

@ -1,5 +1,5 @@
# .ide/Dockerfile # .ide/Dockerfile
FROM python:3.8 FROM python:3.13
# 安装 code-server 和扩展(使用 id 安装 python 扩展,使用 vsix 安装包安装 pylance 扩展) # 安装 code-server 和扩展(使用 id 安装 python 扩展,使用 vsix 安装包安装 pylance 扩展)
RUN curl -fsSL https://code-server.dev/install.sh | sh \ RUN curl -fsSL https://code-server.dev/install.sh | sh \

8
index.html Normal file
View File

@ -0,0 +1,8 @@
<html>
<head>
<title> Hello World </title>
</head>
<body>
<h1> Hello World </h1>
</body>
</html>

21
main.py Normal file
View 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")