initial server stuff
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Created by venv; see https://docs.python.org/3/library/venv.html
|
||||
venv
|
||||
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM python:3.14.3-trixie
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["flask", "--app", "./src/main", "run", "--host=0.0.0.0"]
|
||||
18
compose.yaml
Normal file
18
compose.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
services:
|
||||
api:
|
||||
build: .
|
||||
command: ["flask", "--app", "./src/main", "--debug", "run", "--host=0.0.0.0"]
|
||||
ports:
|
||||
- 5000:5000
|
||||
develop:
|
||||
watch:
|
||||
- action: sync
|
||||
path: ./src
|
||||
target: /app/src
|
||||
- action: rebuild
|
||||
path: requirements.txt
|
||||
- action: rebuild
|
||||
path: Dockerfile
|
||||
- action: rebuild
|
||||
path: compose.yaml
|
||||
|
||||
37
potato.yaml
Normal file
37
potato.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
services:
|
||||
proxy:
|
||||
container_name: traefik
|
||||
image: traefik
|
||||
web:
|
||||
build: ./foundry-manager
|
||||
command: ["npm", "run", "dev"]
|
||||
ports:
|
||||
- 5173:5173
|
||||
- 8080:8080
|
||||
develop:
|
||||
watch:
|
||||
- action: sync
|
||||
path: ./foundry-manager/src
|
||||
target: /app/src
|
||||
- action: rebuild
|
||||
path: ./foundry-manager/package.json
|
||||
- action: rebuild
|
||||
path: ./foundry-manager/Dockerfile
|
||||
- action: restart
|
||||
path: compose.yaml
|
||||
api:
|
||||
build: ./server
|
||||
command: ["flask", "--app", "./src/main", "--debug", "run", "--host=0.0.0.0"]
|
||||
ports:
|
||||
- 5000:5000
|
||||
develop:
|
||||
watch:
|
||||
- action: sync
|
||||
path: ./server/src
|
||||
target: /app/src
|
||||
- action: rebuild
|
||||
path: ./server/requirements.txt
|
||||
- action: rebuild
|
||||
path: ./server/Dockerfile
|
||||
- action: rebuild
|
||||
path: ./server/compose.yaml
|
||||
7
requirements.txt
Normal file
7
requirements.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
blinker==1.9.0
|
||||
click==8.3.1
|
||||
Flask==3.1.3
|
||||
itsdangerous==2.2.0
|
||||
Jinja2==3.1.6
|
||||
MarkupSafe==3.0.3
|
||||
Werkzeug==3.1.6
|
||||
BIN
src/__pycache__/main.cpython-314.pyc
Normal file
BIN
src/__pycache__/main.cpython-314.pyc
Normal file
Binary file not shown.
20
src/main.py
Normal file
20
src/main.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from flask import Flask, jsonify, request
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route("/api/active_tables")
|
||||
def hello():
|
||||
return jsonify([{
|
||||
"a": 1,
|
||||
"b": "b",
|
||||
"potato": "potato"
|
||||
}])
|
||||
|
||||
@app.route("/api/tables")
|
||||
def potato():
|
||||
return jsonify([{
|
||||
"id": 1,
|
||||
"table_name": "Nuntis",
|
||||
"table_link": "vtt.cyberpunkrush.com/nuntis",
|
||||
"active": False
|
||||
}])
|
||||
Reference in New Issue
Block a user