Skip to content

Instantly share code, notes, and snippets.

@manjurulhoque
Forked from amitavroy/Dockerfile
Created June 16, 2019 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manjurulhoque/554bbd9a343895a889e4931a375a91ea to your computer and use it in GitHub Desktop.
Save manjurulhoque/554bbd9a343895a889e4931a375a91ea to your computer and use it in GitHub Desktop.
Docker setup with Laravel
<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>
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment