flaviuse / mern-authentication

MERN stack authentication boilerplate: password reset, email verification, server sessions, redux, typescript, hooks and docker for dev and prod.
https://mern-auth-client.herokuapp.com/login
MIT License
439 stars 95 forks source link

how to run nginx server in docker #172

Closed PhantomGuru0427 closed 11 months ago

PhantomGuru0427 commented 1 year ago

Hi, I am trying to run product mode in your project, and there is no console error. So I tried to access via browser using https, but it seem not to be access server. At this point, once I access via browser, there is some content updates in terminal on my server. I don't know if it works exactly.

HargunSandhu commented 1 year ago

Build the Docker image: Open a terminal or command prompt and navigate to the directory where you created the Dockerfile. Run the following command to build the Docker image:

docker build -t my-nginx .

Run the Docker container: Once the Docker image is built, you can run a container based on that image. Use the following command:

docker run -d -p 80:80 --name my-nginx-container my-nginx

Access the Nginx server: After running the container, you should be able to access the Nginx server by opening a web browser and navigating to http://localhost.