diff options
author | 2021-05-04 00:15:56 +0300 | |
---|---|---|
committer | 2022-01-30 09:37:06 +0400 | |
commit | a3c5b9771fc5e0407e181cca2222eab1187d2d62 (patch) | |
tree | 4917f1f4d09b1b8f23f61921baf740b30adb34d1 /docker-compose.yaml | |
parent | Adds Docker File (diff) |
Adds Docker Compose
Includes backend and all dependencies, loads project files as volumes,
and forwards port 3000.
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'docker-compose.yaml')
-rw-r--r-- | docker-compose.yaml | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..d66ff9b --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,52 @@ +version: "3.6" + +services: + mongo: + image: mongo:latest + ports: + - 27017:27017 + environment: + MONGO_INITDB_ROOT_USERNAME: forms-backend + MONGO_INITDB_ROOT_PASSWORD: forms-backend + MONGO_INITDB_DATABASE: pydis_forms + + snekbox: + image: ghcr.io/python-discord/snekbox:latest + ipc: none + ports: + - "127.0.0.1:8060:8060" + privileged: true + + backend: + image: ghcr.io/python-discord/forms-backend + ports: + - 8000:8000 + environment: + - DATABASE_URL=mongodb://forms-backend:forms-backend@mongo:27017 + - SNEKBOX_URL=http://snekbox:8060/eval + - OAUTH2_CLIENT_ID + - OAUTH2_CLIENT_SECRET + - ALLOWED_URL + - DEBUG=true + - PRODUCTION=false + env_file: + - .env + + frontend: + build: + context: . + dockerfile: Dockerfile + depends_on: + - backend + volumes: + - ./public:/app/public:ro + - ./src:/app/src:ro + - ./.swcrc:/app/.swcrc:ro + - ./tsconfig.json:/app/tsconfig.json:ro + - ./webpack.config.js:/app/webpack.config.js:ro + ports: + - 3000:3000 + environment: + - BACKEND_URL=http://localhost:8000/ + env_file: + - .env |