-
Notifications
You must be signed in to change notification settings - Fork 57
/
Dockerfile
30 lines (22 loc) · 1.06 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
FROM python:2-alpine3.8
# create a non-privileged user to use at runtime
RUN addgroup -g 50 -S pgadmin \
&& adduser -D -S -h /pgadmin -s /sbin/nologin -u 1000 -G pgadmin pgadmin \
&& mkdir -p /pgadmin/config /pgadmin/storage \
&& chown -R 1000:50 /pgadmin
# Install postgresql tools for backup/restore
RUN apk add --no-cache libedit postgresql \
&& cp /usr/bin/psql /usr/bin/pg_dump /usr/bin/pg_dumpall /usr/bin/pg_restore /usr/local/bin/ \
&& apk del postgresql
RUN apk add --no-cache postgresql-dev libffi-dev
ENV PGADMIN_VERSION=3.6
ENV PYTHONDONTWRITEBYTECODE=1
RUN apk add --no-cache alpine-sdk linux-headers \
&& pip install --upgrade pip \
&& echo "https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v${PGADMIN_VERSION}/pip/pgadmin4-${PGADMIN_VERSION}-py2.py3-none-any.whl" | pip install --no-cache-dir -r /dev/stdin \
&& apk del alpine-sdk linux-headers
EXPOSE 5050
COPY LICENSE config_distro.py /usr/local/lib/python2.7/site-packages/pgadmin4/
USER pgadmin:pgadmin
CMD ["python", "./usr/local/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py"]
VOLUME /pgadmin/