Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx support? #270

Closed
pratyushbarik opened this issue Jun 22, 2017 · 6 comments
Closed

Nginx support? #270

pratyushbarik opened this issue Jun 22, 2017 · 6 comments

Comments

@pratyushbarik
Copy link

Is there an Nginx support? If yes, then how do I swap Apache for Nginx?

@lmakarov
Copy link
Member

There is no nginx support at the moment. When the time comes, it is going to be address as part of #143.

@ArtuGit
Copy link

ArtuGit commented Nov 28, 2017

@lmakarov
Nginx support still has not returned?

@lmakarov
Copy link
Member

Nginx support still has not returned?

@ArtuGit nope, has not been a priority, sorry.

If you want a quick a dirty solution with a "DO NOT USE THIS" disclaimer, then here's how one can use https://github.com/wodby/drupal-nginx (the Docker4Drupal image library) with Docksal.

Step 1
Assuming you are using the default Docksal stack (DOCKSAL_STACK=default is set in docksal.env), add the following overrides in docksal(-local).yml

version: "2.1"

services:
  web:
    image: wodby/drupal-nginx:latest
    volumes:
      # Suppress the permissions fixer script in wodby/drupal-nginx
      - ${PROJECT_ROOT}/.docksal/services/web/fix-permissions.sh:/usr/local/bin/fix-permissions.sh
    environment:
      - NGINX_BACKEND_HOST=cli
      - NGINX_SERVER_ROOT=/var/www/${DOCROOT}
    working_dir: /var/www/${DOCROOT}

If you are using a custom stack configuration (services are defined in full in docksal.yml), replace the web service definition with the following:

  web:
    image: wodby/drupal-nginx:latest
    volumes:
      - ${PROJECT_ROOT}:/var/www:ro
      # Suppress the permissions fixer script in wodby/drupal-nginx
      - ${PROJECT_ROOT}/.docksal/services/web/fix-permissions.sh:/usr/local/bin/fix-permissions.sh
    labels:
      - io.docksal.virtual-host=${VIRTUAL_HOST},*.${VIRTUAL_HOST}
      - io.docksal.project-root=${PROJECT_ROOT}
    environment:
      - NGINX_BACKEND_HOST=cli
      - NGINX_SERVER_ROOT=/var/www/${DOCROOT}
    dns:
      - ${DOCKSAL_DNS1}
      - ${DOCKSAL_DNS2}
    working_dir: /var/www/${DOCROOT}

Step 2

Create fix-permissions.sh (this is a hack to suppress that script in wodby/drupal-nginx):

cd <project-root>
mkdir -p .docksal/services/web
echo 'echo "dummy script"' > .docksal/services/web/fix-permissions.sh
chmod +x .docksal/services/web/fix-permissions.sh

Step 3

fin up

The end result is usable, but remember the disclaimer above ;)

image

@lmakarov
Copy link
Member

@ArtuGit
Copy link

ArtuGit commented Dec 1, 2017

@lmakarov Thank.
Did you try this on Drupal 7?

@lmakarov
Copy link
Member

lmakarov commented Dec 1, 2017

@ArtuGit that was Drupal 8, did not try it with 7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants