Last active
October 24, 2016 12:12
-
-
Save ianrodrigues/1a90aaf40a5166960e2c949b90215a7b to your computer and use it in GitHub Desktop.
Dockerfile
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' | |
networks: | |
appinet: | |
driver: 'bridge' | |
services: | |
mysql: | |
image: mysql:5.7.16 | |
# volumes: | |
# - ./mysql:/var/lib/mysql | |
environment: | |
- MYSQL_ROOT_PASSWORD=root | |
- MYSQL_DATABASE=database_name | |
networks: | |
- appinet | |
web: | |
build: ./path_to_Dockerfile | |
volumes: | |
- .:/src | |
- ./storage/app/public:/src/public/storage | |
links: | |
- mysql | |
networks: | |
- appinet | |
ports: | |
- 80:80 | |
- 443:443 | |
depends_on: | |
- 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
FROM ianrodriguesbr/nginx_php-fpm | |
MAINTAINER Ian Rodrigues <ianrodriguesbr@gmail.com> | |
RUN apt-get update && apt-get install apt-utils locales -y \ | |
&& sed -i -e 's/# pt_BR.UTF-8 UTF-8/pt_BR.UTF-8 UTF-8/' /etc/locale.gen \ | |
&& locale-gen \ | |
&& echo "America/Fortaleza" > /etc/timezone \ | |
&& dpkg-reconfigure tzdata \ | |
&& sed -i "s/;date.timezone =/date.timezone = America\/Fortaleza/" /etc/php/7.0/cli/php.ini \ | |
&& sed -i "s/;date.timezone =/date.timezone = America\/Fortaleza/" /etc/php/7.0/fpm/php.ini | |
ADD start.sh /start.sh | |
ADD example.conf /etc/nginx/sites-enabled/example.conf | |
RUN chmod a+x /start.sh | |
ENTRYPOINT ["/start.sh"] |
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; | |
server_name example.com; | |
root /src/public; | |
index index.php index.html index.htm; | |
# access_log /proc/self/fd/1; | |
# error_log /proc/self/fd/2 warn; | |
location / { | |
sendfile off; | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
location ~ \.php$ { | |
try_files $uri /index.php =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
} |
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
#!/usr/bin/env bash | |
STORAGE=/src/storage | |
BOOTSTRAP_CACHE=/src/bootstrap/cache | |
chown -R www-data:www-data ${STORAGE} ${BOOTSTRAP_CACHE} | |
chmod -R 777 ${STORAGE} ${BOOTSTRAP_CACHE} | |
php artisan migrate | |
php artisan optimize | |
/etc/init.d/php7.0-fpm restart && nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment