Skip to content
Advertisement

Can’t access Adonis from Docker Container

I use Docker to contain my Adonis app. The build was success but when I access the app, I got ERR_SOCKET_NOT_CONNECTED or ERR_CONNECTION_RESET.

My docker compose contains adonis and database. Previously, I use the setup similar with this for my expressjs app, and it has no problem.

The adonis .env is remain standard, modification.

This is my setup:

JavaScript
JavaScript

I couldn’t spot anything wrong with my setup.

Advertisement

Answer

The serve command starts the HTTP server on the port defined inside the .env file in the project root.

You should have something like this(note that HOST has to be set to 0.0.0.0 instead of localhost to accept connections from the outside):

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement