jguyomard / docker-laravel

:whale: Docker Images for Laravel development
MIT License
109 stars 62 forks source link

Dockerfile for nginx not needed #8

Closed pschaub closed 6 years ago

pschaub commented 6 years ago

The dockerfile for nginx is not needed.

Here is a full example how to use nginx without an own "Dockerfile for nginx":

version: '3'
services:

  # Application
  app:
    build:
      context: .
      dockerfile: ./.docker/app/app.dockerfile
    volumes:
      - codevolume:/var/www

  # Web server
  web:
    image: nginx
    volumes:
      - ./.docker/web/vhost.conf:/etc/nginx/conf.d/default.conf
      - codevolume:/var/www
    depends_on:
      - app
    ports:
      - 8080:80
      - 8443:443

volumes:
  codevolume:

(This is just an example.)

jguyomard commented 6 years ago

Hello,

Thank you for your feedback. I know you can define nginx configuration with a volume, but i want to have a docker image that works out of the box. Currently, I just have to copy the docker-compose.yml file in my project.