Techiio-author
Started by Lidig TinilaloOct 1, 2021

Open
How to expose a Nodejs app with DDEV web container on local port 80 - 443 with SSL

2 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 2 VIEWES SHARE

Expose nodejs app witch execute on port 3001 on DDEV web container, and access with local port 80 - 443 with SSL for access with https:myproject.ddev.site without add any port.

All without create a new container docker-compose.*.yaml

1 Replies

Techiio-commentator replied 3 months ago0 likes0 dislikes

To expose 3001 port and work with local ports 80-443, you have to create an adapter docker-compose file that extends the web container configuration to expose 3001 port and mapping with your local ports 80-443

docker-compose file example:

version: '3.6'
services:
  web:
    expose:
      - 3001
    environment:
      - HTTP_EXPOSE=${DDEV_MAILHOG_PORT}:8025,80:3001
      - HTTPS_EXPOSE=${DDEV_MAILHOG_HTTPS_PORT}:8025,443:3001

Then, run ddev ssh, and execute your app nodejs and open https://yourproject.ddev.site

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance