From 7a212edd8357d24e2dd88bc455418aaa895bc3c8 Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Mon, 23 Mar 2020 10:03:43 -0700 Subject: Move snekbox.cfg to a config directory There will be more config files to come so it's cleaner to have them together than littering the root directory with more files. --- docker/venv.Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'docker') diff --git a/docker/venv.Dockerfile b/docker/venv.Dockerfile index fe5b10d..5c0fcfc 100644 --- a/docker/venv.Dockerfile +++ b/docker/venv.Dockerfile @@ -6,7 +6,7 @@ ENV PIP_NO_CACHE_DIR=false \ PIPENV_HIDE_EMOJIS=1 \ PIPENV_NOSPIN=1 -COPY Pipfile Pipfile.lock snekbox.cfg /snekbox/ +COPY Pipfile Pipfile.lock /snekbox/ WORKDIR /snekbox RUN if [ -n "${DEV}" ]; \ @@ -15,3 +15,6 @@ RUN if [ -n "${DEV}" ]; \ else \ pipenv install --deploy --system; \ fi + +# At the end to avoid re-installing dependencies when only a config changes. +COPY config/ /snekbox/config -- cgit v1.2.3 From 76c5e84ba17eb8540f097497c9c3df0c6e65831a Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Mon, 23 Mar 2020 10:15:58 -0700 Subject: Fix #66: venv being created in container `pipenv run` creates a venv because it cannot detect that a --system install was done. The solution is to invoke gunicorn directly. --- docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docker') diff --git a/docker/Dockerfile b/docker/Dockerfile index 5ef8a88..b6c2f77 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,7 @@ FROM pythondiscord/snekbox-venv:latest -ENTRYPOINT ["pipenv", "run"] -CMD ["snekbox"] +ENTRYPOINT ["gunicorn"] +CMD ["-c", "config/gunicorn.conf.py", "snekbox.api.app"] COPY . /snekbox WORKDIR /snekbox -- cgit v1.2.3