-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
71,996 additions
and
14 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,5 @@ Homestead.json | |
Homestead.yaml | ||
npm-debug.log | ||
yarn-error.log | ||
docker/mysql/tmp/ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
version: '3' | ||
|
||
services: | ||
mysql: | ||
build: | ||
context: . | ||
dockerfile: ./docker/mysql/Dockerfile | ||
environment: | ||
MYSQL_ROOT_PASSWORD: 'root' | ||
MYSQL_DATABASE: 'reserbath_dev' | ||
volumes: | ||
- ./docker/mysql/tmp/mysql:/var/lib/mysql | ||
- ./docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf | ||
ports: | ||
- "3306:3306" | ||
redis: | ||
build: | ||
context: . | ||
dockerfile: ./docker/redis/Dockerfile | ||
php: | ||
build: | ||
context: . | ||
dockerfile: ./docker/php/Dockerfile | ||
environment: | ||
DB_HOST: $DB_HOST | ||
tty: true | ||
stdin_open: true | ||
volumes: | ||
- .:/usr/src/reserbath-web | ||
- ./docker/php/php.ini:/usr/local/etc/php/php.ini | ||
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf | ||
- /usr/src/reserbath-web/vendor | ||
depends_on: | ||
- mysql | ||
- redis | ||
- nodejs | ||
- mailhog | ||
nginx: | ||
build: | ||
context: . | ||
dockerfile: ./docker/nginx/Dockerfile | ||
volumes: | ||
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf | ||
- ./docker/nginx/conf.d/reserbath.conf:/etc/nginx/conf.d/reserbath.conf | ||
- ./public:/usr/src/reserbath-web/public | ||
ports: | ||
- "80:80" | ||
depends_on: | ||
- php | ||
nodejs: | ||
build: | ||
context: . | ||
dockerfile: ./docker/nodejs/Dockerfile | ||
volumes: | ||
- .:/usr/src/reserbath-web | ||
- /usr/src/reserbath-web/node_modules | ||
entrypoint: npm run dev | ||
mailhog: | ||
image: mailhog/mailhog | ||
ports: | ||
- "8025:8025" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM mysql:5.7.12 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[client] | ||
default-character-set=utf8mb4 | ||
[mysqld] | ||
character-set-server=utf8mb4 | ||
binlog-format=MIXED | ||
innodb_buffer_pool_load_at_startup=OFF |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM nginx:1.15.6-alpine | ||
ENV APP_ROOT /usr/src/reserbath-web | ||
|
||
RUN mkdir $APP_ROOT | ||
|
||
COPY ./public $APP_ROOT/public | ||
COPY ./docker/nginx/nginx.conf /etc/nginx/nginx.conf | ||
COPY ./docker/nginx/conf.d/reserbath.conf /etc/nginx/conf.d/reserbath.conf | ||
|
||
EXPOSE 80 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
server { | ||
client_max_body_size 16M; | ||
server_name *.reserbath-local.jp; | ||
listen 80; | ||
root /usr/src/reserbath-web/public; | ||
index index.php; | ||
|
||
# serve static files directly. | ||
location ~* \.(jpg|jpeg|gif|png|js|css|ico|html)$ { | ||
access_log off; | ||
expires max; | ||
} | ||
|
||
# removes trailing slashes (prevents SEO duplicate content issues). | ||
if (!-d $request_filename) { | ||
rewrite ^/(.+)/$ /$1 permanent; | ||
} | ||
|
||
# serve php contents. | ||
location / { | ||
try_files $uri $uri/ /index.php?$query_string; | ||
} | ||
|
||
location ~* \.php$ { | ||
try_files $uri = 404; | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
fastcgi_pass php:9000; | ||
fastcgi_index index.php; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
user nginx; | ||
worker_processes auto; | ||
|
||
error_log /dev/stdout warn; | ||
pid /var/run/nginx.pid; | ||
|
||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$host" "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /dev/stdout main; | ||
|
||
sendfile on; | ||
tcp_nopush on; | ||
|
||
keepalive_timeout 65; | ||
|
||
gzip on; | ||
gzip_vary on; | ||
gzip_min_length 1024; | ||
gzip_proxied any; | ||
gzip_types | ||
# text/html is always compressed by HttpGzipModule | ||
text/plain | ||
text/css | ||
text/xml | ||
text/javascript | ||
application/json | ||
application/javascript | ||
application/x-javascript | ||
application/xml | ||
application/xml+rss | ||
image/svg+xml; | ||
|
||
server { | ||
listen 80; | ||
|
||
location = /health_check { | ||
access_log off; | ||
return 200 "healthy\n"; | ||
} | ||
} | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:8.15.0-alpine | ||
ENV APP_ROOT /usr/src/reserbath-web | ||
|
||
RUN mkdir -p $APP_ROOT | ||
WORKDIR $APP_ROOT | ||
|
||
COPY package.json $APP_ROOT | ||
COPY package-lock.json $APP_ROOT | ||
|
||
RUN apk add --update --no-cache \ | ||
git \ | ||
&& \ | ||
npm install | ||
|
||
COPY . $APP_ROOT |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
FROM node:8.15.0-alpine AS nodejs | ||
ENV APP_ROOT /usr/src/reserbath-web | ||
|
||
RUN mkdir -p $APP_ROOT | ||
WORKDIR $APP_ROOT | ||
|
||
COPY package.json $APP_ROOT | ||
COPY package-lock.json $APP_ROOT | ||
|
||
RUN apk add --update --no-cache \ | ||
git \ | ||
&& \ | ||
npm install | ||
|
||
COPY . $APP_ROOT | ||
|
||
RUN npm run production | ||
|
||
|
||
FROM php:7.2.12-fpm-alpine3.8 | ||
ENV APP_ROOT /usr/src/reserbath-web | ||
ENV COMPOSER_ALLOW_SUPERUSER 1 | ||
|
||
RUN mkdir $APP_ROOT | ||
WORKDIR $APP_ROOT | ||
|
||
COPY docker/php/php.ini /usr/local/etc/php/php.ini | ||
COPY docker/php/www.conf /usr/local/etc/php-fpm.d/www.conf | ||
COPY docker/php/wait-for-it.sh /usr/src/wait-for-it.sh | ||
COPY composer.json $APP_ROOT | ||
COPY composer.lock $APP_ROOT | ||
|
||
SHELL ["/bin/sh", "-o", "pipefail", "-c"] | ||
RUN apk update && \ | ||
apk add --update --no-cache \ | ||
bash=4.4.19-r1 \ | ||
mysql-client \ | ||
zlib-dev \ | ||
&& \ | ||
NPROC="$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1)" && \ | ||
docker-php-ext-install -j"${NPROC}" pdo_mysql zip && \ | ||
wget https://raw.githubusercontent.com/composer/getcomposer.org/6cc488c7604093278748e0b4fb9b80f21141ecb8/web/installer -O - -q \ | ||
| php -- --quiet --install-dir=/usr/local/bin --filename composer && \ | ||
composer install --no-interaction --no-autoloader --no-scripts | ||
|
||
COPY --from=nodejs $APP_ROOT $APP_ROOT | ||
|
||
RUN composer dump-autoload --optimize | ||
|
||
VOLUME /usr/src/reserbath-web/public/assets | ||
|
||
ENTRYPOINT ["sh", "-c", "/usr/src/wait-for-it.sh $DB_HOST:3306 -t 60 -- php artisan migrate --force && docker-php-entrypoint php-fpm -R"] |
Oops, something went wrong.