Problems in MERN dockerized project
Hello SteveLTN, and thanks for your work! I'm trying to use your https-portal in a MERN dockerized project but I don't know how to use it. My docker-compose.yml has this code:
version: '3.3'
services: server: build: context: ./server dockerfile: Dockerfile image: myapp-server container_name: myapp-node-server command: /usr/src/app/node_modules/.bin/nodemon index.js volumes: - ./server/:/usr/src/app - /usr/src/app/node_modules ports: - "3000:3000" depends_on: - mongo env_file: ./server/.env environment: - NODE_ENV=development networks: - app-network
mongo: image: mongo volumes: - data-volume:/data/db ports: - "27017:27017" networks: - app-network
https-portal: image: steveltn/https-portal:1 depends_on: - client ports: - 80:80 - 443:443 restart: always volumes: - ./ssl_certs:/var/lib/https-portal environment: DOMAINS: 'pp.pp.com -> http://client:8000' # STAGE: 'production' # Don't use production until staging works # FORCE_RENEW: 'true' networks: - app-network
client: build: context: ./client dockerfile: Dockerfile image: myapp-client stdin_open: true container_name: myapp-react-client command: npm start volumes: - ./client/:/usr/app - /usr/app/node_modules depends_on: - server ports: - "8000:8000" networks: - app-network
networks: app-network: driver: bridge
volumes: data-volume: node_modules: web-root: driver: local
But I don't know how to connect to the express server with https and get data from my mongodb. Could you help me?
Thank you very much.
Juan Torres
Which service is your express server? Is it client? And does it work without HTTPS? If client is your express server, make sure it works from port 8000 first. Then you can try putting HTTPS-PORTAL on top of it.