fix: docker python path and data creation
All checks were successful
ci/woodpecker/push/publish Pipeline was successful
All checks were successful
ci/woodpecker/push/publish Pipeline was successful
This commit is contained in:
parent
359a3ffb9a
commit
62e45befa2
2 changed files with 8 additions and 2 deletions
|
@ -5,6 +5,7 @@ FROM python:3.11.6-alpine3.18
|
||||||
RUN addgroup -S td && adduser -S td -G td
|
RUN addgroup -S td && adduser -S td -G td
|
||||||
|
|
||||||
WORKDIR /txtdiary
|
WORKDIR /txtdiary
|
||||||
|
RUN mkdir ./data && chown td:td ./data
|
||||||
|
|
||||||
COPY LICENSE .
|
COPY LICENSE .
|
||||||
|
|
||||||
|
@ -15,4 +16,9 @@ COPY ./src ./app
|
||||||
|
|
||||||
USER td
|
USER td
|
||||||
|
|
||||||
CMD [ "uwsgi", "--http", "0.0.0.0:80", "-Mw" ,"app.app", "--callable", "app" ]
|
|
||||||
|
CMD [ "uwsgi", \
|
||||||
|
"--http", "0.0.0.0:80", "-M", \
|
||||||
|
"-w", "app", \
|
||||||
|
"--callable", "app", \
|
||||||
|
"--pythonpath", "/txtdiary/app" ]
|
||||||
|
|
|
@ -7,7 +7,7 @@ from utils.config import Config
|
||||||
app = Flask(__name__, static_url_path="/")
|
app = Flask(__name__, static_url_path="/")
|
||||||
|
|
||||||
# import all routes
|
# import all routes
|
||||||
for file in glob("src/routes/*.py"):
|
for file in glob("*/routes/*.py"):
|
||||||
module = file.replace("/", ".").split(".")[-2]
|
module = file.replace("/", ".").split(".")[-2]
|
||||||
exec(f"from routes.{module} import router as {module}")
|
exec(f"from routes.{module} import router as {module}")
|
||||||
exec(f"app.register_blueprint({module})")
|
exec(f"app.register_blueprint({module})")
|
||||||
|
|
Loading…
Reference in a new issue