Created
January 2, 2017 11:02
-
-
Save anonymous/a13cf604981726c8e8b0bb05a35664e2 to your computer and use it in GitHub Desktop.
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.0.4-fpm | |
RUN apt-get update && apt-get install -y libmcrypt-dev \ | |
mysql-client libmagickwand-dev --no-install-recommends \ | |
&& pecl install imagick \ | |
&& docker-php-ext-enable imagick \ | |
&& docker-php-ext-install mcrypt pdo_mysql |
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: '2' | |
services: | |
# The Application | |
app: | |
build: | |
context: ./ | |
dockerfile: app.dockerfile | |
working_dir: /var/www | |
volumes: | |
- ./:/var/www | |
environment: | |
- "DB_PORT=3306" | |
- "DB_HOST=database" | |
# The Web Server | |
web: | |
build: | |
context: ./ | |
dockerfile: web.dockerfile | |
working_dir: /var/www | |
volumes_from: | |
- app | |
ports: | |
- 8080:80 | |
# The Database | |
database: | |
image: mysql:5.6 | |
volumes: | |
- dbdata:/var/lib/mysql | |
environment: | |
- "MYSQL_ROOT_PASSWORD=secret" | |
- "MYSQL_DATABASE=homestead" | |
- "MYSQL_USER=homestead" | |
ports: | |
- "33061:3306" | |
volumes: | |
dbdata: |
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
server { | |
listen 80; | |
index index.php index.html; | |
root /var/www/public; | |
location / { | |
try_files $uri /index.php?$args; | |
} | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass app:9000; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
} | |
} |
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 nginx:1.10 | |
ADD vhost.conf /etc/nginx/conf.d/default.conf |
Hello, everything runs smoothly BUT all assets on the Laravel installation return a 404 error, any ideas?
check where you /app placed
app:
build:
context: ./
dockerfile: app.dockerfile
working_dir: /var/www
volumes:
- ./:/var/www
environment:
- "DB_PORT=3306"
- "DB_HOST=database"
in my case from root of app and my folder named e.g. myapp there located all project
I recommended check vhost.conf and docker-compose.yml.
Also, you could compare you files with
https://github.com/shakyShane/laravel-docker
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found error after just posted my issue :)
do this
sudo chmod -R 777 storage && sudo chmod -R 777 bootstrap/cache
and m.b. regenerate keys
docker-compose exec app php artisan key:generate
docker-compose exec app php artisan optimize
in my case it works.