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 ./pyproject.toml /app/
|
||||
|
||||
# RUN poetry install
|
||||
|
||||
COPY ./mealie /app/mealie
|
||||
|
||||
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"]
|
|
@ -29,7 +29,7 @@ services:
|
|||
db_type: sqlite
|
||||
TZ: America/Anchorage # Specify Correct Timezone for Date/Time to line up correctly.
|
||||
volumes:
|
||||
- ./app_data:/app_data
|
||||
- ./dev/data:/app/dev/data
|
||||
- ./mealie:/app/mealie
|
||||
|
||||
# Mkdocs
|
||||
|
|
2
makefile
2
makefile
|
@ -53,8 +53,6 @@ setup: ## Setup Development Instance
|
|||
cd ..
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
|
|
@ -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.site_settings import all_settings
|
||||
from mealie.routes.users import users
|
||||
from mealie.db import init_db
|
||||
from mealie.services.image import minify
|
||||
|
||||
app = FastAPI(
|
||||
title="Mealie",
|
||||
|
@ -51,6 +53,8 @@ start_scheduler()
|
|||
|
||||
|
||||
def main():
|
||||
init_db.main()
|
||||
minify.migrate_images()
|
||||
|
||||
uvicorn.run(
|
||||
"app:app",
|
||||
|
|
|
@ -47,11 +47,12 @@ def default_user_init(session: Session):
|
|||
logger.info("Generating Default User")
|
||||
db.users.create(session, default_user)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
if sql_exists:
|
||||
print("Database Exists")
|
||||
exit()
|
||||
else:
|
||||
print("Database Doesn't Exists, Initializing...")
|
||||
init_db()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue