I am having an issue with docker-compose containers. There is certainly an answer somewhere but it seems I don’t have the vocabulary necessary to find it, sorry.
Here is my docker-compose file :
version: '2'
services:
gateway-linkcs:
image: node:7
ports:
- 3000:3000
volumes:
- ../Gateway:/usr/src/app
working_dir: /usr/src/app
command: yarn startdev
networks:
- back-linkcs
- internet
postgres-user-linkcs:
build:
context: ../User
dockerfile: docker/Dockerfile
networks:
- back-linkcs
dev-user-linkcs:
image: node:7
ports:
- 3001:3001
volumes_from:
- postgres-user-linkcs
volumes:
- ../User:/usr/src/app
working_dir: /usr/src/app
command: /usr/src/app/docker/scripts/start-node.sh
environment:
- NODE_ENV=development # change to 'production' for prod
- GATEWAY_ADDRESS=gateway-linkcs:3000
networks:
- back-linkcs
networks:
back-linkcs:
internet
I would like to have the gateway connected to the internet (since I it has to connect to an online API), but I don’t want user and postgres to be connected to the internet, I want them to be on a separated network.
What is the good way to do this ?
I use Docker version 17.03.1-ce, build c6d412e, on Mac OSX 10.12.4
Thank you very much, Giltho.