Mercurial > libervia-backend
annotate docker/pubsub/Dockerfile @ 3487:75427f0a5445
primivitus: updated constants following global renaming, config section is now `tui` instead of `primitivus`
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 21 Mar 2021 18:16:52 +0100 |
parents | d2298ed6de7f |
children | 73e04040d577 |
rev | line source |
---|---|
3445
fc83c4996c77
docker: use `slim` version of Debian as base for our images
Goffi <goffi@goffi.org>
parents:
3381
diff
changeset
|
1 FROM debian:buster-slim |
3381 | 2 |
3 LABEL maintainer="Goffi <tmp_dockerfiles@goffi.org>" | |
4 | |
5 ARG DEBIAN_FRONTEND=noninteractive | |
6 | |
3446
d2298ed6de7f
docker (pubsub): install latest version of `postgresql-client` with PostgreSQL own Debian repos.
Goffi <goffi@goffi.org>
parents:
3445
diff
changeset
|
7 RUN \ |
d2298ed6de7f
docker (pubsub): install latest version of `postgresql-client` with PostgreSQL own Debian repos.
Goffi <goffi@goffi.org>
parents:
3445
diff
changeset
|
8 |
3381 | 9 RUN apt-get update && apt-get upgrade -y && \ |
3446
d2298ed6de7f
docker (pubsub): install latest version of `postgresql-client` with PostgreSQL own Debian repos.
Goffi <goffi@goffi.org>
parents:
3445
diff
changeset
|
10 apt-get install -y --no-install-recommends locales python3-dev python3-venv python3-wheel mercurial libpq-dev gcc gnupg && \ |
d2298ed6de7f
docker (pubsub): install latest version of `postgresql-client` with PostgreSQL own Debian repos.
Goffi <goffi@goffi.org>
parents:
3445
diff
changeset
|
11 # we install postgresql repository to have latest version |
d2298ed6de7f
docker (pubsub): install latest version of `postgresql-client` with PostgreSQL own Debian repos.
Goffi <goffi@goffi.org>
parents:
3445
diff
changeset
|
12 echo "deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ |
d2298ed6de7f
docker (pubsub): install latest version of `postgresql-client` with PostgreSQL own Debian repos.
Goffi <goffi@goffi.org>
parents:
3445
diff
changeset
|
13 python3 -c 'from urllib.request import urlopen; print(urlopen("https://www.postgresql.org/media/keys/ACCC4CF8.asc").read().decode())' | apt-key add - && \ |
d2298ed6de7f
docker (pubsub): install latest version of `postgresql-client` with PostgreSQL own Debian repos.
Goffi <goffi@goffi.org>
parents:
3445
diff
changeset
|
14 # now we can install the client |
d2298ed6de7f
docker (pubsub): install latest version of `postgresql-client` with PostgreSQL own Debian repos.
Goffi <goffi@goffi.org>
parents:
3445
diff
changeset
|
15 apt-get install -y --no-install-recommends postgresql-client && \ |
3381 | 16 # it's better to have a dedicated user |
17 useradd -m sat && \ | |
18 mkdir /src && chown sat:sat /src && \ | |
19 # we need UTF-8 locale | |
20 sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen && locale-gen | |
21 | |
22 ENV LC_ALL en_US.UTF-8 | |
23 | |
24 WORKDIR /home/sat | |
25 COPY entrypoint.sh /home/sat | |
26 RUN chown sat:sat /home/sat/entrypoint.sh && chmod 0555 /home/sat/entrypoint.sh | |
27 | |
28 USER sat | |
29 RUN python3 -m venv sat_env && sat_env/bin/pip install wheel && cd /src && \ | |
30 # we install thoses packages in editable mode, so we can replace them easily with volumes | |
31 hg clone https://repos.goffi.org/sat_tmp && ~/sat_env/bin/pip install -e sat_tmp && \ | |
32 mv sat_tmp/sat_tmp.egg-info ~/sat_env/lib/python3.*/site-packages && \ | |
33 hg clone https://repos.goffi.org/sat_pubsub && ~/sat_env/bin/pip install -e sat_pubsub && \ | |
34 mv sat_pubsub/sat_pubsub.egg-info ~/sat_env/lib/python3.*/site-packages | |
35 | |
36 ENTRYPOINT ["/home/sat/entrypoint.sh"] |