mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
Fix docker dev db persistence
This commit is contained in:
parent
6706918736
commit
3aded02ccf
5 changed files with 9 additions and 10 deletions
|
@ -14,12 +14,8 @@ RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-
|
||||||
# Copy poetry.lock* in case it doesn't exist in the repo
|
# Copy poetry.lock* in case it doesn't exist in the repo
|
||||||
COPY ./pyproject.toml /app/
|
COPY ./pyproject.toml /app/
|
||||||
|
|
||||||
# RUN poetry install
|
|
||||||
|
|
||||||
COPY ./mealie /app/mealie
|
COPY ./mealie /app/mealie
|
||||||
|
|
||||||
RUN poetry install
|
RUN poetry install
|
||||||
|
|
||||||
RUN ["poetry", "run", "python", "mealie/db/init_db.py"]
|
|
||||||
RUN ["poetry", "run", "python", "mealie/services/image/minify.py"]
|
|
||||||
CMD ["poetry", "run", "python", "mealie/app.py"]
|
CMD ["poetry", "run", "python", "mealie/app.py"]
|
|
@ -29,7 +29,7 @@ services:
|
||||||
db_type: sqlite
|
db_type: sqlite
|
||||||
TZ: America/Anchorage # Specify Correct Timezone for Date/Time to line up correctly.
|
TZ: America/Anchorage # Specify Correct Timezone for Date/Time to line up correctly.
|
||||||
volumes:
|
volumes:
|
||||||
- ./app_data:/app_data
|
- ./dev/data:/app/dev/data
|
||||||
- ./mealie:/app/mealie
|
- ./mealie:/app/mealie
|
||||||
|
|
||||||
# Mkdocs
|
# Mkdocs
|
||||||
|
|
2
makefile
2
makefile
|
@ -53,8 +53,6 @@ setup: ## Setup Development Instance
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
backend: ## Start Mealie Backend Development Server
|
backend: ## Start Mealie Backend Development Server
|
||||||
poetry run python mealie/db/init_db.py && \
|
|
||||||
poetry run python mealie/services/image/minify.py && \
|
|
||||||
poetry run python mealie/app.py
|
poetry run python mealie/app.py
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,8 @@ from mealie.routes.mealplans import mealplans
|
||||||
from mealie.routes.recipe import all_recipe_routes, category_routes, recipe_crud_routes, tag_routes
|
from mealie.routes.recipe import all_recipe_routes, category_routes, recipe_crud_routes, tag_routes
|
||||||
from mealie.routes.site_settings import all_settings
|
from mealie.routes.site_settings import all_settings
|
||||||
from mealie.routes.users import users
|
from mealie.routes.users import users
|
||||||
|
from mealie.db import init_db
|
||||||
|
from mealie.services.image import minify
|
||||||
|
|
||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title="Mealie",
|
title="Mealie",
|
||||||
|
@ -51,6 +53,8 @@ start_scheduler()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
init_db.main()
|
||||||
|
minify.migrate_images()
|
||||||
|
|
||||||
uvicorn.run(
|
uvicorn.run(
|
||||||
"app:app",
|
"app:app",
|
||||||
|
|
|
@ -47,11 +47,12 @@ def default_user_init(session: Session):
|
||||||
logger.info("Generating Default User")
|
logger.info("Generating Default User")
|
||||||
db.users.create(session, default_user)
|
db.users.create(session, default_user)
|
||||||
|
|
||||||
|
def main():
|
||||||
if __name__ == "__main__":
|
|
||||||
if sql_exists:
|
if sql_exists:
|
||||||
print("Database Exists")
|
print("Database Exists")
|
||||||
exit()
|
|
||||||
else:
|
else:
|
||||||
print("Database Doesn't Exists, Initializing...")
|
print("Database Doesn't Exists, Initializing...")
|
||||||
init_db()
|
init_db()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Loading…
Add table
Add a link
Reference in a new issue