Skip to content

Instantly share code, notes, and snippets.

@kerrongordon
Forked from amitavroy/Dockerfile
Created March 7, 2019 17:22
Show Gist options
  • Select an option

  • Save kerrongordon/9f1623c3f4f021a6d065d5240e1268b6 to your computer and use it in GitHub Desktop.

Select an option

Save kerrongordon/9f1623c3f4f021a6d065d5240e1268b6 to your computer and use it in GitHub Desktop.

Revisions

  1. @amitavroy amitavroy created this gist Nov 18, 2018.
    22 changes: 22 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    FROM php:7.2.10-apache-stretch

    RUN apt-get update -yqq && \
    apt-get install -y apt-utils zip unzip && \
    apt-get install -y nano && \
    apt-get install -y libzip-dev libpq-dev && \
    a2enmod rewrite && \
    docker-php-ext-install pdo_pgsql && \
    docker-php-ext-install pgsql && \
    docker-php-ext-configure zip --with-libzip && \
    docker-php-ext-install zip && \
    rm -rf /var/lib/apt/lists/*

    RUN php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer

    COPY default.conf /etc/apache2/sites-enabled/000-default.conf

    WORKDIR /var/www/app

    CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]

    EXPOSE 80
    9 changes: 9 additions & 0 deletions default.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <VirtualHost *:80>
    ServerName localhost

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/app/public

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>
    32 changes: 32 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    version: '3'

    services:
    web:
    container_name: ${APP_NAME}_web
    build:
    context: ./docker/web
    ports:
    - 9000:80
    volumes:
    - ./:/var/www/app
    db:
    container_name: ${APP_NAME}_db
    image: postgres:10.5
    ports:
    - 5432:5432
    volumes:
    - ./pgdata:/var/lib/postgresql/data
    environment:
    - POSTGRES_PASSWORD=secret
    - POSTGRES_USER=homestead
    - POSTGRES_DB=homestead
    cache:
    container_name: ${APP_NAME}_cache
    image: redis:4.0.11
    ports:
    - 63790:6379
    search:
    container_name: ${APP_NAME}_search
    image: elasticsearch:6.4.1
    ports:
    - 6200:9200