From e189c8264f72d1689990a2fc5494ef12afa8596b Mon Sep 17 00:00:00 2001 From: Alexandre Teles Date: Thu, 19 Oct 2023 18:25:33 -0300 Subject: [PATCH] Revert "build: slim down the docker container (#60)" This reverts commit 80b858c5785468003c4df010ba206be2407c616e. --- .dockerignore | 6 ------ .gitignore | 2 +- Dockerfile | 32 ++++---------------------------- docker/run-backend.sh | 1 - docker/run-healthcheck.sh | 1 - 5 files changed, 5 insertions(+), 37 deletions(-) delete mode 100644 .dockerignore delete mode 100755 docker/run-backend.sh delete mode 100755 docker/run-healthcheck.sh diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 283963c..0000000 --- a/.dockerignore +++ /dev/null @@ -1,6 +0,0 @@ -.idea -.devcontainer -.git -.gitignore -.github -.vscode diff --git a/.gitignore b/.gitignore index 5110429..5085a1b 100644 --- a/.gitignore +++ b/.gitignore @@ -157,7 +157,7 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -.idea/ +#.idea/ # custom env.sh diff --git a/Dockerfile b/Dockerfile index 874ad3d..9668e5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,36 +1,12 @@ -## Build dependencies -FROM python:3.11-slim as dependencies - -WORKDIR /usr/src/app - -RUN apt-get update && \ - apt-get install -y --no-install-recommends gcc git \ - && rm -rf /var/lib/apt/lists/* - -RUN python -m venv /opt/venv -ENV PATH="/opt/venv/bin:$PATH" - -COPY requirements.txt . - -RUN pip install -r requirements.txt - -## Image FROM python:3.11-slim +ARG GITHUB_TOKEN +ENV GITHUB_TOKEN $GITHUB_TOKEN + WORKDIR /usr/src/app -RUN apt-get update && \ - apt-get install -y --no-install-recommends curl \ - && rm -rf /var/lib/apt/lists/* - -ENV PATH="/opt/venv/bin:$PATH" - -COPY --from=dependencies /opt/venv /opt/venv COPY . . VOLUME persistance -CMD docker/run-backend.sh -HEALTHCHECK CMD docker/run-healthcheck.sh - -EXPOSE 8000 +CMD [ "python3", "-m" , "sanic", "app:app", "--fast", "--access-logs", "--motd", "--noisy-exceptions", "-H", "0.0.0.0"] diff --git a/docker/run-backend.sh b/docker/run-backend.sh deleted file mode 100755 index 1e7b51a..0000000 --- a/docker/run-backend.sh +++ /dev/null @@ -1 +0,0 @@ -python3 -m sanic /usr/src/app --fast --access-logs --motd --noisy-exceptions -H 0.0.0.0 diff --git a/docker/run-healthcheck.sh b/docker/run-healthcheck.sh deleted file mode 100755 index 1c514a5..0000000 --- a/docker/run-healthcheck.sh +++ /dev/null @@ -1 +0,0 @@ -curl --fail http://0.0.0.0:8000/docs