Skip to content

A starter project to easily simulate a Nginx server (inside a docker container) with help of common ubuntu commands

Notifications You must be signed in to change notification settings

bastiansmn/nginx-docker-with-ubuntu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nginx-docker-with-ubuntu

A starter project to easily simulate a Nginx server (inside a docker container) with help of common ubuntu commands.

Usage :

First, I highly encourage you to create a volume dedicated to your in-docker Nginx server.

docker volume create nginx-server-volume

And then you can build and run the container with the volume associated.

docker build . -t nginx-server
docker run  \
   --name nginx-server \
   -d \
   -p 80:80 \
   -p 2222:22 \
   -v nginx-sever-volume:/volume \
   nginx-server 

Alternatively, you can simple run ./run.sh, the script will do everything to create the docker container for you.

Once the docker container is running, you can connect it via SSH with the command below. The password is just nginx. You can change that in the Dockerfile line 28 ($(echo "<your_password>" ...)

ssh nginx@localhost -p 2222

Note that the nginx user is already a super user, so you don't need to grant any permissions.

Once everything is set up, you can edit your ssh config file to easily connect to the fake server.

...

Host nginx-docker
    HostName localhost
    User nginx
    AddKeysToAgent yes
    Port 2222

About

A starter project to easily simulate a Nginx server (inside a docker container) with help of common ubuntu commands

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published