Skip to content

Instantly share code, notes, and snippets.

@anish137i
Created June 10, 2020 19:31
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 anish137i/a5773832a5649499c4b1c3702e866b4c to your computer and use it in GitHub Desktop.
Save anish137i/a5773832a5649499c4b1c3702e866b4c to your computer and use it in GitHub Desktop.
Docker Laravel Apache Postgres and redis
version: '3'
services:
web:
container_name: ${APP_NAME}_web
build:
context: ./docker/web
ports:
- 9191:80
volumes:
- ./:/var/www/html
db:
container_name: ${APP_NAME}_db
image: postgres:12.3
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=secret
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_DB=${DB_DATABASE}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- ./postgres_data:/var/lib/postgresql
cache:
container_name: ${APP_NAME}_cache
image: redis:6.0.5
ports:
- 63790:6379
<VirtualHost *:80>
ServerName localhost
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
FROM php:7.2.10-apache-stretch
WORKDIR /var/www/html
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
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
EXPOSE 80
@anish137i
Copy link
Author

Docker Details

  • PHP 7.2.10-apache-stretch (Apache Include)
  • POSTGRES 12.3
  • REDIS 6.0.5

Webserver is running on Port 9000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment