From ce673531b12d082350a4996f4ed54a84ac007e3c Mon Sep 17 00:00:00 2001 From: eug-vs Date: Tue, 27 Oct 2020 15:42:10 +0300 Subject: build: add docker configs --- docker-compose.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docker-compose.yml (limited to 'docker-compose.yml') diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..392d48a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3' +services: + app: + container_name: which-api + restart: always + build: . + ports: + - '3030:3030' + links: + - db + db: + container_name: mongo + image: mongo -- cgit v1.2.3 From 1b48b401ad64f0b8994338fd88dad78d78be3bf0 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Tue, 27 Oct 2020 15:50:04 +0300 Subject: build: expose 27017 port on Mongo --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docker-compose.yml') diff --git a/docker-compose.yml b/docker-compose.yml index 392d48a..1894901 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,3 +11,5 @@ services: db: container_name: mongo image: mongo + ports: + - '27017:27017' -- cgit v1.2.3 From a5feeaaca74d82a99bbb8063afee51cb9984f978 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 7 Nov 2020 12:36:39 +0300 Subject: feat: provide local MONGODB_URI in correct step --- docker-compose.yml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docker-compose.yml') diff --git a/docker-compose.yml b/docker-compose.yml index 1894901..f163ecd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,16 @@ +# Build and run which-api with database in container +# +# If you are getting "port already in use" error, +# try changing exposed ports, e.g 27017:27017 -> 27018:27017 + version: '3' services: app: container_name: which-api restart: always build: . + environment: + - MONGODB_URI=mongodb://db:27017/which ports: - '3030:3030' links: -- cgit v1.2.3