Created
June 10, 2020 19:31
-
-
Save anish137i/a5773832a5649499c4b1c3702e866b4c to your computer and use it in GitHub Desktop.
Docker Laravel Apache Postgres and redis
This file contains 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: '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 |
This file contains 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
<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> |
This file contains 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 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Docker Details
Webserver is running on Port 9000