From 48c3d4832e354377b6dc6e8319a8d42da80c731a Mon Sep 17 00:00:00 2001 From: Clemens Wolff Date: Fri, 28 Jun 2019 11:02:46 -0400 Subject: [PATCH] Avoid running docker image as root --- Dockerfile | 7 +++++-- README.md | 2 +- azuredeploy.json | 8 ++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 133823e1..6ac8298c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,18 +29,21 @@ RUN cd /doccano \ FROM python:${PYTHON_VERSION}-slim AS runtime +RUN useradd -ms /bin/sh doccano + COPY --from=builder /deps /deps RUN pip install --no-cache-dir /deps/*.whl -COPY --from=cleaner /doccano /doccano +COPY --from=cleaner --chown=doccano:doccano /doccano /doccano ENV DEBUG="True" ENV SECRET_KEY="change-me-in-production" -ENV PORT="80" +ENV PORT="8000" ENV WORKERS="2" ENV GOOGLE_TRACKING_ID="" ENV AZURE_APPINSIGHTS_IKEY="" +USER doccano WORKDIR /doccano EXPOSE ${PORT} diff --git a/README.md b/README.md index 181a703c..73e6e2b0 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ Depending on your installation method, there are two options: First, run a Docker container: ```bash -docker run -d --name doccano -p 8000:80 chakkiworks/doccano +docker run -d --name doccano -p 8000:8000 chakkiworks/doccano ``` Then, execute `create-admin.sh` script for creating a superuser. diff --git a/azuredeploy.json b/azuredeploy.json index 487ed3c3..8623e476 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -271,6 +271,14 @@ "linuxFxVersion": "[concat('DOCKER|', parameters('dockerImageName'))]", "alwaysOn": true, "appSettings": [ + { + "name": "WEBSITES_PORT", + "value": "8000" + }, + { + "name": "PORT", + "value": "8000" + }, { "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", "value": "false"