forked from thaJeztah/pgadmin4-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtemplate-debian.Dockerfile
More file actions
37 lines (29 loc) · 1.28 KB
/
template-debian.Dockerfile
File metadata and controls
37 lines (29 loc) · 1.28 KB
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
# python: %%PYTHON_CANONICAL%%
# pgadmin: %%PGADMIN_CANONICAL%%
FROM python:%%PYTHON_IMAGE%%
MAINTAINER Florian Schroeder <schroeder.florian@gmail.com>
# create a non-privileged user to use at runtime
RUN addgroup --system --gid 51 pgadmin \
&& adduser --system --disabled-password --home /pgadmin --shell /sbin/nologin --uid 1000 --gid 51 pgadmin \
&& mkdir -p /pgadmin/config /pgadmin/storage \
&& chown -R 1000:51 /pgadmin \
&& chmod g=u /etc/passwd
# Install postgresql tools for backup/restore
RUN apt update \
&& apt install -y postgresql-client dos2unix \
&& apt autoremove -y \
&& apt clean
ENV PGADMIN_VERSION=%%PGADMIN%%
ENV PYTHONDONTWRITEBYTECODE=1
RUN pip install --upgrade --no-cache-dir pip \
&& echo "https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v${PGADMIN_VERSION}/pip/%%PGADMIN_WHL%%" | pip install --no-cache-dir -r /dev/stdin \
&& pip install --no-cache-dir --upgrade Flask-WTF
EXPOSE 5050
COPY LICENSE config_distro.py /usr/local/lib/python%%PYTHON%%/site-packages/pgadmin4/
COPY entrypoint.sh /usr/local/bin/
RUN chmod ug=rwx /usr/local/bin/entrypoint.sh \
&& dos2unix /usr/local/bin/entrypoint.sh
USER pgadmin:pgadmin
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
CMD ["python", "./usr/local/lib/python%%PYTHON%%/site-packages/pgadmin4/pgAdmin4.py"]
VOLUME /pgadmin/