Mount nginx configuration files inside docker container

I would like to mount nginx.conf and default.conf to an nginx running container.

docker run --detach --tty --interactive --publish=8081:80 
-v $(pwd)/app:/var/www/ 
-v $(pwd)/configurations/nginx.conf:/etc/nginx/nginx.conf 
-v $(pwd)/configurations/default.conf:/etc/nginx/sites-enabled/default.conf  
--name="my_container" my:dev

I have got a 404 error and when I logged into the docker container I found that the app directory was mount but the default.conf was the default one.

  • Python Tkinter in Docker .TclError: couldn't connect to display
  • Get 502 Bad Gateway when use fastcgi_pass:
  • Create a development environment for Laravel in Docker
  • How do I get the config.v2.json file on windows
  • Docker forking process
  • How can I run container with process.argv in Docker?
  • This is default.conf file:

    server {
        root /var/www;
        index index.html index.htm index.php;
        server_name localhost;
        location / {
            try_files $uri $uri/ /index.php?$query_string =404;
        location ~ \.php$ {
                    fastcgi_split_path_info ^(.+\.php)(/.+)$;
                    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
                    fastcgi_index index.php;
                    include fastcgi_params;
                    fastcgi_buffer_size 128k;
                    fastcgi_buffers 256 16k;
                    fastcgi_busy_buffers_size 256k;
                    fastcgi_temp_file_write_size 256k;
                    fastcgi_read_timeout 240;

  • Sharing volume between docker containers
  • docker-compose volume is empty even from initialize
  • php significant slower on docker then kvm
  • 2 docker containers run in 1 container
  • Cant build a docker dart-runtime image after a local pub-get
  • Oracle DB+Weblogic in a single container
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.