add basic docker setup

This commit is contained in:
Kacper Donat 2020-01-01 22:35:15 +01:00
parent 4cb1d1ead7
commit 190ed5bac9
5 changed files with 63 additions and 4 deletions

16
docker-compose.yml Normal file
View File

@ -0,0 +1,16 @@
version: '3'
services:
nginx:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./:/var/www:cached
- ./docker/nginx/czydojade:/etc/nginx/conf.d/czydojade.conf
php:
build: docker/php
volumes:
- ./:/var/www:cached
- ./docker/php/log.conf:/usr/local/etc/php-fpm.d/zz-log.conf

29
docker/nginx/czydojade Normal file
View File

@ -0,0 +1,29 @@
server {
root /var/www/public/;
server_name czydojade.localhost;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
location ~ \.(js|css)$ {
expires 1y;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass php:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param APP_ENV "dev";
fastcgi_param DATABASE_URL "sqlite:///%kernel.project_dir%/var/app.db";
fastcgi_param GOOGLE_ANALYTICS "UA-00000-00";
internal;
}
}
}

12
docker/php/Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM php:7.3-fpm
RUN pecl install xdebug-2.9.0 && docker-php-ext-enable xdebug
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php composer-setup.php
RUN php -r "unlink('composer-setup.php');"
RUN mv composer.phar /usr/local/bin/composer
RUN chmod +x /usr/local/bin/composer
RUN ln -snf /usr/share/zoneinfo/Europe/Warsaw /etc/localtime
WORKDIR /var/www

2
docker/php/log.conf Normal file
View File

@ -0,0 +1,2 @@
php_admin_flag[log_errors] = on
php_flag[display_errors] = off

View File

@ -2,7 +2,7 @@
<ul class="departures__list list-underlined">
<li class="departure" v-for="departure in departures">
<div class="departure__line">
<line-symbol :line="departure.line"></line-symbol>
<line-symbol :line="departure.line"/>
<div class="line__display">{{ departure.display }}</div>
</div>
@ -18,14 +18,14 @@
</div>
<div class="departure__stop">
<fa :icon="['fal', 'sign']" fixed-width class="mr-1"></fa>
<stop :stop="departure.stop"></stop>
<fa :icon="['fal', 'sign']" fixed-width class="mr-1"/>
<stop :stop="departure.stop"/>
</div>
</li>
</ul>
<div class="alert alert-info" v-if="stops.length === 0">
<fa :icon="['fal', 'info-circle']"></fa>
<fa :icon="['fal', 'info-circle']"/>
Wybierz przystanki korzystając z wyszukiwarki poniżej, aby zobaczyć listę odjazdów.
</div>
</div>