Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. version: '2'
  2.  
  3. services:
  4. webserver:
  5. build: .
  6. ports:
  7. - '8080:80'
  8. volumes:
  9. - ./:/var/www/html
  10. - ./apache.conf:/etc/apache2/sites-available/000-default.conf
  11. depends_on:
  12. - db
  13.  
  14. db:
  15. image: mysql:5.7
  16. restart: always
  17. environment:
  18. MYSQL_ROOT_PASSWORD: root
  19. MYSQL_DATABASE: homestead
  20. MYSQL_USER: homestead
  21. MYSQL_PASSWORD: secret
  22. ports:
  23. - "33061:3306"
  24.  
  25. FROM ubuntu:latest
  26.  
  27. RUN locale-gen en_US.UTF-8
  28. && export LANG=en_US.UTF-8
  29. && apt-get update
  30. && apt-get -y install apache2
  31. RUN apt-get -y install libapache2-mod-php7.0 php7.0 php7.0-cli php-xdebug php7.0-mbstring sqlite3 php7.0-mysql php-imagick php-memcached php-pear curl imagemagick php7.0-dev php7.0-phpdbg php7.0-gd npm nodejs-legacy php7.0-json php7.0-curl php7.0-sqlite3 php7.0-intl apache2 vim git-core wget libsasl2-dev libssl-dev libsslcommon2-dev libcurl4-openssl-dev autoconf g++ make openssl libssl-dev libcurl4-openssl-dev pkg-config libsasl2-dev libpcre3-dev
  32. && a2enmod headers
  33. && a2enmod rewrite
  34.  
  35. ENV APACHE_RUN_USER www-data
  36. ENV APACHE_RUN_GROUP www-data
  37. ENV APACHE_LOG_DIR /var/log/apache2
  38. ENV APACHE_PID_FILE /var/run/apache2.pid
  39. RUN rm $APACHE_PID_FILE -f
  40. ENV APACHE_RUN_DIR /var/run/apache2
  41. ENV APACHE_LOCK_DIR /var/lock/apache2
  42. RUN ln -sf /dev/stdout /var/log/apache2/access.log &&
  43. ln -sf /dev/stderr /var/log/apache2/error.log
  44. RUN mkdir -p $APACHE_RUN_DIR $APACHE_LOCK_DIR $APACHE_LOG_DIR
  45.  
  46. VOLUME [ "/var/www/html" ]
  47. WORKDIR /var/www/html
  48.  
  49. EXPOSE 80
  50.  
  51. ENTRYPOINT [ "/usr/sbin/apache2" ]
  52. CMD ["-D", "FOREGROUND"]
  53.  
  54. $ docker-compose up --build Building webserver
  55. ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
  56.  
  57. If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
  58.  
  59. $ docker run hello-world
  60. Hello from Docker!
  61. .....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement