-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
66 lines (58 loc) · 2.65 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM alpine:3.13
ARG ADMINER_VERSION=4.8.1
RUN mkdir -p /app
WORKDIR /app
# Install
RUN apk update \
&& apk upgrade \
# Install require packages
&& apk add --no-cache curl ca-certificates libcap \
php7 \
php7-mongodb \
php7-pdo_dblib \
php7-pdo_mysql \
php7-pdo_odbc \
php7-pdo_pgsql \
php7-pdo_sqlite \
php7-session \
php7-simplexml \
php7-sqlite3 \
# configure PHP
&& sed -i 's/upload_max_filesize.*=.*/upload_max_filesize = 256M/g' /etc/php7/php.ini \
&& sed -i 's/post_max_size.*=.*/post_max_size = 256M/g' /etc/php7/php.ini \
# Install Adminer
&& curl https://www.adminer.org/static/download/${ADMINER_VERSION}/adminer-${ADMINER_VERSION}.php -s -S -o adminer.php \
# Install plugins (defined in adminer-with-plugins.php)
&& mkdir plugins \
&& curl https://raw.githubusercontent.com/vrana/adminer/master/plugins/plugin.php -s -S -o plugins/plugin.php \
&& curl https://raw.githubusercontent.com/vrana/adminer/master/plugins/dump-bz2.php -s -S -o plugins/dump-bz2.php \
&& curl https://raw.githubusercontent.com/vrana/adminer/master/plugins/login-password-less.php -s -S -o plugins/login-password-less.php \
# Style
&& curl https://raw.githubusercontent.com/vrana/adminer/master/designs/pepa-linha/adminer.css -s -S -o adminer.css \
# Allow PHP to run as a service
&& setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/php7 \
# Clean
&& apk del curl ca-certificates libcap \
&& rm -rf /var/cache/apk/*
COPY adminer-with-plugins.php index.php
# Setup app user
RUN addgroup adminer \
&& adduser -s /sbin/halt -h /app -D -G adminer adminer \
&& chown -R adminer:adminer /app
EXPOSE 80
# At the end as it changes everytime ;)
ARG BUILD_DATE
ARG DOCKER_TAG
ARG VCS_REF
LABEL maintainer="Emmanuel Dyan <[email protected]>" \
org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.name=${DOCKER_TAG} \
org.label-schema.description="Docker Adminer Image based on Alpine and including a few plugins" \
org.label-schema.url="https://cloud.docker.com/u/edyan/repository/docker/edyan/adminer" \
org.label-schema.vcs-url="https://github.com/edyan/docker-adminer" \
org.label-schema.vcs-ref=${VCS_REF} \
org.label-schema.schema-version="1.0" \
org.label-schema.vendor="edyan" \
org.label-schema.docker.cmd="docker run -d --rm ${DOCKER_TAG}"
USER adminer
CMD ["/usr/bin/php7", "-S", "0.0.0.0:80", "-t", "/app"]