Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1580958

Browse files
committedFeb 15, 2016
pinboard docker first commit
0 parents  commit 1580958

File tree

4 files changed

+81
-0
lines changed

4 files changed

+81
-0
lines changed
 

‎Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM alpine:3.3
2+
MAINTAINER Erik DeLamarter <erik.delamarter@choobs.com>
3+
4+
RUN apk add --update \
5+
git \
6+
php \
7+
php-apcu \
8+
php-ctype \
9+
php-json \
10+
php-openssl \
11+
php-pdo_mysql \
12+
php-phar \
13+
&& rm -rf /var/cache/apk/*
14+
15+
RUN mkdir /www
16+
17+
VOLUME /www
18+
19+
COPY phps /bin/
20+
COPY router.php /
21+
COPY docker-entrypoint.sh /
22+
23+
ENTRYPOINT ["/docker-entrypoint.sh"]
24+
25+
EXPOSE 8080
26+
CMD ["phps"]

‎docker-entrypoint.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/sh
2+
3+
if [ "$1" = 'phps' ]; then
4+
if [ ! -f "www/composer.json" ]; then
5+
6+
cd /www
7+
8+
git clone https://github.com/intaro/pinboard.git .
9+
git checkout tags/v1.5.2
10+
11+
php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php
12+
php -r "if (hash('SHA384', file_get_contents('composer-setup.php')) === '781c98992e23d4a5ce559daf0170f8a9b3b91331ddc4a3fa9f7d42b6d981513cdc1411730112495fbf9d59cffbf20fb2') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); }"
13+
php composer-setup.php --install-dir=/bin --filename=composer
14+
php -r "unlink('composer-setup.php');"
15+
16+
cat > /www/config/parameters.yml << EOF
17+
db:
18+
host: ${MYSQL_HOST:-db}
19+
name: pinba
20+
user: ${MYSQL_USER:-root}
21+
pass: ${MYSQL_PASSWORD:-DB_ENV_MYSQL_ROOT_PASSWORD}
22+
base_url: /
23+
logging:
24+
long_request_time:
25+
global: !!float 1
26+
heavy_request:
27+
global: 30000
28+
heavy_cpu_request:
29+
global: 1
30+
locale: en
31+
cache: apc
32+
records_lifetime: P1M
33+
aggregation_period: PT15M
34+
pagination:
35+
row_per_page: 50
36+
secure:
37+
enable: false
38+
EOF
39+
40+
composer install --prefer-source --no-interaction
41+
42+
./console migrations:migrate --no-interaction
43+
44+
fi
45+
fi
46+
47+
exec "$@"

‎phps

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
php -S 0.0.0.0:8080 -t /www/web /router.php

‎router.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
$_SERVER['SERVER_NAME'] = 'localhost';
4+
5+
return false;

0 commit comments

Comments
 (0)
Please sign in to comment.