summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-13 01:09:08 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-13 01:09:08 +0200
commit7a2711de71afe35e58f568347269460b33ad0fd9 (patch)
tree986fbc2f7678ccb79be163cca38bf15aae3306a3
parentMerge pull request #256 from luth31/master (diff)
downloadserver-7a2711de71afe35e58f568347269460b33ad0fd9.tar.xz
:sparkles: docker compose
-rw-r--r--.docker/env1
-rw-r--r--docker-compose.yml24
2 files changed, 25 insertions, 0 deletions
diff --git a/.docker/env b/.docker/env
new file mode 100644
index 00000000..595b7ba2
--- /dev/null
+++ b/.docker/env
@@ -0,0 +1 @@
+MONGO_URL=mongodb://db:27017/fosscord?readPreference=secondaryPreferred
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 00000000..5861e12f
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,24 @@
+version: "3"
+services:
+    db:
+        hostname: fosscord_db
+        image: mongo:latest
+        volumes:
+            - ./db:/data/db
+        restart: unless-stopped
+    api:
+        hostname: fosscord_api
+        image: fosscord/api
+        depends_on:
+            - db
+        ports:
+            - 3001:3001
+        env_file: ./.docker/env
+    gateway:
+        hostname: fosscord_gateway
+        image: fosscord/gateway
+        depends_on:
+            - db
+        ports:
+            - 3002:3002
+        env_file: ./.docker/env
\ No newline at end of file