Created
November 18, 2018 04:10
-
-
Save amitavroy/e049cf28c891d2b4220e75a88591d9d0 to your computer and use it in GitHub Desktop.
Docker setup with Laravel
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/app/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
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 |
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 | |
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
I'm getting this error..!
Building web
[+] Building 100.7s (7/10)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 680B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/php:7.2.10-apache-stretch 3.3s
=> [auth] library/php:pull token for registry-1.docker.io 0.0s
=> CACHED [1/5] FROM docker.io/library/php:7.2.10-apache-stretch@sha256:13f2eba8db9eb40f4a4f38a43716518513991d70698da28d56069ad9119abfab 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 34B 0.0s
=> ERROR [2/5] RUN apt-get update -yqq && apt-get install -y apt-utils zip unzip && apt-get install -y nano && apt-get install -y libzip-dev && a2enmod rewrite && docker-php-ext-install mysqli pdo pdo_mysql && docker-php-ext-configure zip --with-libzi 97.3s
executor failed running [/bin/sh -c apt-get update -yqq && apt-get install -y apt-utils zip unzip && apt-get install -y nano && apt-get install -y libzip-dev && a2enmod rewrite && docker-php-ext-install mysqli pdo pdo_mysql && docker-php-ext-configure zip --with-libzip && docker-php-ext-install zip && rm -rf /var/lib/apt/lists/*]: exit code: 100
ERROR: Service 'web' failed to build : Build failed