Last active
August 11, 2017 18:50
-
-
Save jadon1979/d3c1b598dc18df3da4f14c3a6166b138 to your computer and use it in GitHub Desktop.
quick and dirty docker setup..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # build the base image | |
| $ docker build -t REPLACE_WITH_YOUR_DOMAIN_NAME . | |
| # load up the docker images and run them in the background with -d | |
| $ docker-compose up -d | |
| # load up a shell to the main app | |
| $ docker exec -it REPLACE_WITH_YOUR_DOMAIN_NAME_app_1 bash | |
| # load up a shell to the phpmyadmin container | |
| $ docker exec -it REPLACE_WITH_YOUR_DOMAIN_NAME_phpmyadmin_1 bash | |
| # shut down the containers | |
| $ docker-compose down | |
| # main app http://localhost:8080 | |
| # phpmyadmin http://localhost:8081 | |
| # mailcatcher http://localhost:1080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| version: '2' | |
| services: | |
| app: | |
| hostname: REPLACE_WITH_YOUR_DOMAIN | |
| image: REPLACE_WITH_YOUR_DOMAIN:latest | |
| build: . | |
| volumes: | |
| - .:/var/www/html | |
| ports: | |
| - 8080:80 | |
| tty: true | |
| links: | |
| - mysql | |
| mysql: | |
| image: mysql:5.6 | |
| hostname: mysql | |
| environment: | |
| MYSQL_USER: root | |
| MYSQL_PASSWORD: k3y2!21 | |
| MYSQL_ROOT_PASSWORD: k3y2!21 | |
| volumes: | |
| - /var/lib/mysql | |
| ports: | |
| - 3306:3306 | |
| phpmyadmin: | |
| image: phpmyadmin/phpmyadmin:4.6 | |
| container_name: phpmyadmin | |
| environment: | |
| PMA_HOST: mysql | |
| PMA_PORT: 3306 | |
| PMA_USER: root | |
| PMA_PASSWORD: k3y2!21 | |
| restart: always | |
| links: | |
| - mysql | |
| ports: | |
| - 8081:80 | |
| schickling-mailcatcher: | |
| image: schickling/mailcatcher | |
| ports: | |
| - 1080:1080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu:16.04 | |
| RUN apt-get update && \ | |
| apt-get -y upgrade && \ | |
| apt-get install -y build-essential && \ | |
| apt-get install -y software-properties-common && \ | |
| apt-get install -y vim curl git man unzip wget && \ | |
| apt-get install -y net-tools iputils-ping apache2 apache2-utils | |
| RUN apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "` & \ | |
| LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \ | |
| apt-get update && \ | |
| apt-get install -y php5.6 php5.6-gettext php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml && \ | |
| rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/* | |
| WORKDIR /var/www/html | |
| COPY . /var/www/html | |
| EXPOSE 80 | |
| ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment