Skip to content

Commit

Permalink
Feature: added Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Jun 23, 2018
1 parent f5e8894 commit f5269d1
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .docker/app/Caddyfile
@@ -0,0 +1,13 @@
0.0.0.0
root /srv/app/www
gzip
fastcgi / 127.0.0.1:9000 php
rewrite {
regexp .*
ext /
to /index.php?{query}
}

log stdout
errors stdout
on startup php-fpm --nodaemonize
14 changes: 14 additions & 0 deletions .docker/app/Dockerfile
@@ -0,0 +1,14 @@
FROM php:7.2-fpm-alpine

# Install application dependencies
RUN apk add --no-cache curl bash
RUN curl https://getcaddy.com | bash -s personal http.expires,http.realip
RUN docker-php-ext-install mbstring mysqli pdo pdo_mysql

ADD . /srv/app
ADD .docker/app/Caddyfile /etc/Caddyfile

WORKDIR /srv/app/
RUN chown -R www-data:www-data /srv/app

CMD ["/usr/local/bin/caddy", "--conf", "/etc/Caddyfile", "--log", "stdout"]
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -20,3 +20,7 @@
# Files
!.gitignore
!.htaccess

# Docker
/.docker/data
/docker-compose.override.yml
15 changes: 15 additions & 0 deletions docker-compose.dev.yml
@@ -0,0 +1,15 @@
version: '3.5'

services:
app:
environment:
NETTE_DEBUG: 1
volumes:
- ./:/srv/app:delegated

db:
image: mariadb:10.3
environment:
MYSQL_ROOT_PASSWORD: componette
volumes:
- ./.docker/data/db:/var/lib/mysql
9 changes: 9 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,9 @@
version: '3.5'

services:
app:
build:
context: .
dockerfile: .docker/app/Dockerfile
ports:
- 8000:2015

0 comments on commit f5269d1

Please sign in to comment.