diff --git a/.docker/data/.keep b/.docker/data/.keep new file mode 100644 index 0000000..e69de29 diff --git a/.docker/env b/.docker/env new file mode 100644 index 0000000..df6d28c --- /dev/null +++ b/.docker/env @@ -0,0 +1 @@ +MONGO_URL=mongodb://mongo:27017/fosscord?readPreference=secondaryPreferred \ No newline at end of file diff --git a/.docker/mongodb/mongod.conf b/.docker/mongodb/mongod.conf new file mode 100644 index 0000000..cbe0a2a --- /dev/null +++ b/.docker/mongodb/mongod.conf @@ -0,0 +1,2 @@ +replication: + replSetName: "rs0" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 54fd98d..44f9f5d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ node_modules/ -.DS_STORE \ No newline at end of file +.DS_STORE +.docker/data/* +!.docker/data/.keep \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3a4eae5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,26 @@ +version: "3" +services: + fosscord-gateway: + container_name: gateway + restart: always + build: gateway + ports: + - "3002:3002" + links: + - mongo + env_file: ./.docker/env + fosscord-api: + container_name: api + restart: always + build: api + ports: + - "3001:3001" + mongo: + container_name: mongo + image: mongo + volumes: + - ./.docker/data:/data/db + - ./.docker/mongodb/mongod.conf:/etc/mongod.conf + ports: + - "27017:27017" + command: ["-f", "/etc/mongod.conf"] \ No newline at end of file