Last active
March 11, 2019 02:47
-
-
Save wayanjimmy/0f6a154cd6d8c738d89fd9654bacaa98 to your computer and use it in GitHub Desktop.
Laravel Docker Permission Error
This file contains hidden or 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: | |
image: nginx:latest | |
ports: | |
- "8000:80" | |
volumes: | |
- .:/usr/web/ | |
- ./site.conf:/etc/nginx/conf.d/default.conf | |
links: | |
- app | |
restart: unless-stopped | |
db: | |
image: mysql:5.7 | |
volumes: | |
- mysqldata:/var/lib/mysql | |
environment: | |
- MYSQL_DATABASE=database | |
- MYSQL_ROOT_PASSWORD=root | |
adminer: | |
image: adminer | |
restart: always | |
ports: | |
- "8080:8080" | |
environment: | |
ADMINER_PLUGINS: "dump-json" | |
app: | |
build: | |
context: . | |
volumes: | |
- .:/usr/web/ | |
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini | |
restart: unless-stopped | |
redis: | |
image: redis | |
command: ["redis-server", "--appendonly", "yes"] | |
hostname: redis | |
volumes: | |
- redisdata:/data | |
volumes: | |
mysqldata: | |
redisdata: |
This file contains hidden or 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.3-fpm | |
RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libpq-dev libzip-dev git\ | |
&& rm -rf /var/lib/apt/lists/* \ | |
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ | |
&& docker-php-ext-install gd mbstring pdo pdo_mysql pdo_pgsql zip bcmath exif | |
#Get Composer | |
RUN curl -o /tmp/composer-setup.php https://getcomposer.org/installer \ | |
&& curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \ | |
# Make sure we're installing what we think we're installing! | |
&& php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); echo 'Invalid installer' . PHP_EOL; exit(1); }" \ | |
&& php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer --snapshot \ | |
&& rm -f /tmp/composer-setup.* | |
#Get Imagick | |
RUN export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \ | |
&& apt-get update \ | |
&& apt-get install -y --no-install-recommends \ | |
libmagickwand-dev \ | |
ghostscript \ | |
libgs-dev \ | |
&& rm -rf /var/lib/apt/lists/* \ | |
&& pecl install imagick \ | |
&& docker-php-ext-enable imagick | |
# Create app directory | |
WORKDIR /usr/web | |
COPY . . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment