Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '2'
- services:
- webserver:
- build: .
- ports:
- - '8080:80'
- volumes:
- - ./:/var/www/html
- - ./apache.conf:/etc/apache2/sites-available/000-default.conf
- depends_on:
- - db
- db:
- image: mysql:5.7
- restart: always
- environment:
- MYSQL_ROOT_PASSWORD: root
- MYSQL_DATABASE: homestead
- MYSQL_USER: homestead
- MYSQL_PASSWORD: secret
- ports:
- - "33061:3306"
- FROM ubuntu:latest
- RUN locale-gen en_US.UTF-8
- && export LANG=en_US.UTF-8
- && apt-get update
- && apt-get -y install apache2
- 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
- && a2enmod headers
- && a2enmod rewrite
- ENV APACHE_RUN_USER www-data
- ENV APACHE_RUN_GROUP www-data
- ENV APACHE_LOG_DIR /var/log/apache2
- ENV APACHE_PID_FILE /var/run/apache2.pid
- RUN rm $APACHE_PID_FILE -f
- ENV APACHE_RUN_DIR /var/run/apache2
- ENV APACHE_LOCK_DIR /var/lock/apache2
- RUN ln -sf /dev/stdout /var/log/apache2/access.log &&
- ln -sf /dev/stderr /var/log/apache2/error.log
- RUN mkdir -p $APACHE_RUN_DIR $APACHE_LOCK_DIR $APACHE_LOG_DIR
- VOLUME [ "/var/www/html" ]
- WORKDIR /var/www/html
- EXPOSE 80
- ENTRYPOINT [ "/usr/sbin/apache2" ]
- CMD ["-D", "FOREGROUND"]
- $ docker-compose up --build Building webserver
- ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
- If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
- $ docker run hello-world
- Hello from Docker!
- .....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement