-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (38 loc) · 1.5 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
FROM debian AS builder
LABEL project="pgtg"
ENV PROJECT_NAME 'pgtg'
ENV PG_VERSION '14'
ENV PG_CLUSTER 'main'
ENV TZ 'Europe/Moscow'
ENV LANG 'ru_RU.UTF-8'
ENV LC_ALL 'ru_RU.UTF-8'
RUN set -eux; \
echo $TZ > /etc/timezone; \
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen; \
echo "ru_RU.UTF-8 UTF-8" >> /etc/locale.gen; \
apt-get update && apt-get install -y tzdata locales; \
rm /etc/localtime; \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \
dpkg-reconfigure -f noninteractive tzdata; \
dpkg-reconfigure -f noninteractive locales; \
update-locale; \
apt-get clean; \
apt-get update -y;
RUN set -eux; \
apt-get install apt-utils bash build-essential cmake cmake-data g++ gcc libcurl4-openssl-dev libssl-dev make pkg-config sudo wget git htop mc lsb-release -y; \
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'; \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -; \
apt-get update -y; \
apt-get install postgresql libpq-dev postgresql-server-dev-all -y;
WORKDIR /opt/$PROJECT_NAME
COPY . .
RUN set -eux; \
cp docker/default.conf conf/default.conf; \
cp docker/default.json conf/sites/default.json; \
cmake -DCMAKE_BUILD_TYPE=Release . -B cmake-build-release; \
cd cmake-build-release; \
make install;
RUN set -eux; \
pg_dropcluster $PG_VERSION $PG_CLUSTER;
COPY ./docker/run.sh /opt/run.sh
CMD ["bash", "/opt/run.sh"]