diff --git a/docker-compose.yml b/docker-compose.yml index f03e0cc..93596f7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,6 +17,10 @@ services: environment: - WATCHFILES_FORCE_POLLING=true - # for development: runs with hot reload, reloads server when the config folder changes - command: ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "2626", "--reload", "--reload-dir", "/spil_conf"] + # for development: + # Runs demo config inside mapped ./spil_hamlet_conf folder (mapped to /spil_conf inside docker) + # Starts uvicorn with hot reload (reloads server when the config folder changes) + command: > + sh -c "python -c \"import spil;import hamlet_scripts.save_examples_to_mock_fs as mfs;mfs.run()\" && + uvicorn main:app --host 0.0.0.0 --port 2626 --reload --reload-dir /spil_conf" # See https://www.uvicorn.org/settings/ \ No newline at end of file diff --git a/spil_server/docker/Dockerfile b/spil_server/docker/Dockerfile index 5cdca72..2e7d511 100644 --- a/spil_server/docker/Dockerfile +++ b/spil_server/docker/Dockerfile @@ -17,11 +17,6 @@ ENV PYTHONPATH="${PYTHONPATH}:/spil:/spil_conf" # spil_hamlet_conf contains the spil demo config COPY ./spil_hamlet_conf /spil/spil_hamlet_conf -# Init test data -# Only used for builtin demo. Can be removed for real usage. -# PYTHONDONTWRITEBYTECODE avoids to have __pycache__ in the Image -RUN export PYTHONDONTWRITEBYTECODE=1 && python -c "import spil;import hamlet_scripts.save_examples_to_mock_fs as mfs;mfs.run()" - # App will contain the fastapi app # Starting app:main.py is already included in the base docker image (tiangolo/uvicorn-gunicorn-fastapi) COPY ./spil_server/fastapi/app /app \ No newline at end of file