From dedcf82c91c440e068a817888e44da41d880aa49 Mon Sep 17 00:00:00 2001 From: Sean Stoves Date: Mon, 23 Sep 2024 16:40:36 -0400 Subject: [PATCH] Updating for a DockerCompose Dev environment. --- Dockerfile-dev | 19 +++++++++++++++++++ docker-compose.yml | 12 ++++++++++++ docker/config-development.py | 4 ++-- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 Dockerfile-dev create mode 100644 docker-compose.yml diff --git a/Dockerfile-dev b/Dockerfile-dev new file mode 100644 index 0000000..f739301 --- /dev/null +++ b/Dockerfile-dev @@ -0,0 +1,19 @@ +FROM python:3.10 + +ARG ENVIRONMENT=development + +RUN useradd --create-home avraeservice +USER avraeservice +WORKDIR /home/avraeservice + +COPY --chown=avraeservice:avraeservice requirements.txt . +RUN pip install --user --no-warn-script-location -r requirements.txt + +COPY --chown=avraeservice:avraeservice . . + +COPY --chown=avraeservice:avraeservice docker/config-${ENVIRONMENT}.py config.py + +# Download AWS pubkey to connect to documentDB +RUN wget https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem + +ENTRYPOINT .local/bin/gunicorn --workers 2 --bind 0:8000 app:app diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b789752 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3.8' + +services: + app: + build: + context: . + dockerfile: Dockerfile-dev + container_name: avrae_io + ports: + - "8000:8080" + environment: + - NODE_ENV=development \ No newline at end of file diff --git a/docker/config-development.py b/docker/config-development.py index ebc5882..975e023 100644 --- a/docker/config-development.py +++ b/docker/config-development.py @@ -5,8 +5,8 @@ ENVIRONMENT = "Development" # Default to `avrae` docker-compose hosts, allow override via environment variables -MONGO_URL = os.getenv("MONGO_URL", "mongodb://root:topsecret@localhost:58017/avrae") -REDIS_URL = os.getenv("REDIS_URL", "redis://redis:58379/0") +MONGO_URL = os.getenv("MONGO_URL", "mongodb://root:topsecret@host.docker.internal:58017/avrae?authSource=admin") +REDIS_URL = os.getenv("REDIS_URL", "redis://host.docker.internal:58379/0") SENTRY_DSN = os.getenv("SENTRY_DSN") # discord oauth