This repository has been archived by the owner on Aug 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from lynxluna/feature/docker-single
Attemp to Dockerise using self-contained image
- Loading branch information
Showing
9 changed files
with
240 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/.web-server-pid | ||
/app/config/parameters.yml | ||
/build/ | ||
/phpunit.xml | ||
/var/* | ||
!/var/cache | ||
/var/cache/* | ||
!var/cache/.gitkeep | ||
!/var/logs | ||
/var/logs/* | ||
!var/logs/.gitkeep | ||
!/var/sessions | ||
/var/sessions/* | ||
!var/sessions/.gitkeep | ||
!var/SymfonyRequirements.php | ||
/vendor/ | ||
/web/bundles/ | ||
/web/uploads/areas/*.png | ||
/web/uploads/areas/*.jpg | ||
/web/uploads/areas/*.gif | ||
/web/uploads/fields/*.png | ||
/web/uploads/fields/*.jpg | ||
/web/uploads/fields/*.gif | ||
/web/uploads/seeds/*.png | ||
/web/uploads/seeds/*.jpg | ||
/web/uploads/seeds/*.gif | ||
/web/uploads/areas/*.PNG | ||
/web/uploads/areas/*.JPG | ||
/web/uploads/areas/*.GIF | ||
/web/uploads/fields/*.PNG | ||
/web/uploads/fields/*.JPG | ||
/web/uploads/fields/*.GIF | ||
/web/uploads/seeds/*.PNG | ||
/web/uploads/seeds/*.JPG | ||
/web/uploads/seeds/*.GIF | ||
# Swap | ||
[._]*.s[a-v][a-z] | ||
[._]*.sw[a-p] | ||
[._]s[a-v][a-z] | ||
[._]sw[a-p] | ||
|
||
# Session | ||
Session.vim | ||
|
||
# Temporary | ||
.netrwhist | ||
*~ | ||
# Auto-generated tag files | ||
tags | ||
|
||
.DS_Store | ||
docker/**/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
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,22 @@ | ||
language: php | ||
|
||
dist: trusty | ||
|
||
sudo: required | ||
|
||
php: | ||
- '7.1' | ||
|
||
install: | ||
- cp -a .env-example .env | ||
- composer install --no-interaction | ||
|
||
script: | ||
- ./vendor/bin/phpunit | ||
|
||
after_success: | ||
- docker build -t tanibox/tania -f docker/app/Dockerfile --build-arg BUILD_DATE="$(date +%Y-%m-%d)" . | ||
|
||
branches: | ||
only: | ||
- development |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
version: '2.2' | ||
|
||
services: | ||
|
||
app: | ||
image: tanibox/tania:latest | ||
build: | ||
dockerfile: docker/app/Dockerfile | ||
context: . | ||
environment: | ||
SYMFONY_LOCALE: en | ||
SYMFONY_SECRET: AugIVKlefKLzqJwlwY5S5YaW8Ui66fi8 | ||
SYMFONY_ENV: dev | ||
SYMFONY_DB_HOST: db | ||
SYMFONY_DB_PORT: 3306 | ||
SYMFONY_DB_NAME: tania | ||
SYMFONY_DB_USERNAME: tania | ||
SYMFONY_DB_PASSWORD: taniapass | ||
SYMFONY_MAILER_TRANSPORT: smtp | ||
SYMFONY_MAILER_HOST: 127.0.0.1 | ||
SYMFONY_MAILER_USERNAME: admin | ||
SYMFONY_MAILER_PASSWORD: admin | ||
SYMFONY_MAILER_FROM_ADDRESS: [email protected] | ||
SYMFONY_MAILER_SENDER_NAME: yourname | ||
COMPOSER_ALLOW_SUPERUSER: 1 | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- '.:/var/www' | ||
- '$HOME/.composer:/var/www/.composer' | ||
db: | ||
image: 'mysql:5.6' | ||
environment: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: tania | ||
MYSQL_USER: tania | ||
MYSQL_PASSWORD: taniapass | ||
ports: | ||
- "3306:3306" |
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 @@ | ||
version: '2.2' | ||
|
||
services: | ||
app: | ||
image: tanibox/tania:latest | ||
|
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,28 @@ | ||
FROM tanibox/php7-fpm-nginx-supervisord | ||
|
||
MAINTAINER Didiet Noor <[email protected]> | ||
|
||
ARG BUILD_DATE | ||
|
||
LABEL org.label-schema.build-date=$BUILD_DATE \ | ||
org.label-schema.name="Tania Web Application" \ | ||
org.label-schema.description="Build artifact for Tania" \ | ||
org.label-schema.url="http://gettania.org/" \ | ||
org.label-schema.vcs-ref=$VCS_REF \ | ||
org.label-schema.vcs-url="https://github.com/Tanibox/tania.git" \ | ||
org.label-schema.vendor="Tania" \ | ||
org.label-schema.version="1.2-beta" \ | ||
org.label-schema.schema-version="1.0" | ||
|
||
ADD . /var/www | ||
COPY ./docker/app/nginx.conf /etc/nginx/nginx.conf | ||
COPY ./docker/app/tania-entrypoint /usr/local/bin/ | ||
VOLUME /var/www/var/cache | ||
WORKDIR /var/www | ||
|
||
EXPOSE 80 | ||
|
||
RUN touch /var/www/.env \ | ||
&& COMPOSER_ALLOW_SUPERUSER=1 composer install --no-autoloader --no-scripts --no-dev | ||
|
||
ENTRYPOINT [ "/usr/local/bin/tania-entrypoint" ] |
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,49 @@ | ||
user www-data; | ||
worker_processes 4; | ||
pid /run/nginx.pid; | ||
daemon off; | ||
|
||
events { | ||
worker_connections 2048; | ||
multi_accept on; | ||
use epoll; | ||
} | ||
|
||
http { | ||
server_tokens off; | ||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
keepalive_timeout 15; | ||
types_hash_max_size 2048; | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
access_log off; | ||
error_log off; | ||
gzip on; | ||
gzip_disable "msie6"; | ||
open_file_cache max=100; | ||
|
||
server { | ||
root /var/www/web; | ||
|
||
location / { | ||
try_files $uri @rewriteapp; | ||
} | ||
|
||
location @rewriteapp { | ||
rewrite ^(.*)$ /app.php/$1 last; | ||
} | ||
|
||
location ~ ^/(app|app_dev|config)\.php(/|$) { | ||
fastcgi_pass unix:/var/run/php-fpm.sock; | ||
fastcgi_split_path_info ^(.+\.php)(/.*)$; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param HTTPS off; | ||
} | ||
|
||
error_log /dev/stdout info; | ||
access_log /dev/stdout; | ||
} | ||
} |
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,23 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
composer install | ||
|
||
chown www-data:www-data -R /var/www/var/cache | ||
chown www-data:www-data -R /var/www/var/logs | ||
chown www-data:www-data -R /var/www/var/sessions | ||
|
||
|
||
if [ ! -d /tmp ]; then | ||
mkdir -p /tmp | ||
fi | ||
|
||
if [ ! -e /tmp/stdout ]; then | ||
mkfifo -m 666 /tmp/stdout | ||
fi | ||
|
||
cat <> /tmp/stdout 1>&2 & | ||
|
||
|
||
# Needed for Alpine | ||
/usr/bin/supervisord -n -c /etc/supervisord.conf |