-
Notifications
You must be signed in to change notification settings - Fork 0
/
DockerfileDatabase
executable file
·57 lines (44 loc) · 1.72 KB
/
DockerfileDatabase
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
FROM postgres:13.7
# Set timezone
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN if [ -f ./deploy_configuration/.env_proxy ]; then \
# Si le fichier source existe, copiez-le
COPY ./deploy_configuration/.env_proxy /; \
fi
COPY ./deploy_configuration/proxy.sh /
RUN chmod +x /proxy.sh
RUN sh /proxy.sh
ARG HTTP_PROXY_CI
ENV http_proxy=$HTTP_PROXY_CI
ENV https_proxy=$HTTP_PROXY_CI
ENV HTTP_PROXY=$HTTP_PROXY_CI
ENV HTTPS_PROXY=$HTTP_PROXY_CI
# Vérifiez si la variable d'environnement http_proxy est définie
RUN if [ -n "$http_proxy" ]; then \
# Si elle est définie, exécutez les commandes pour configurer le proxy
touch /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::HTTP::Proxy "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::HTTPS::Prox "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::ftp::Proxy "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo "Proxy configuré dans le système de packages avec la valeur $http_proxy" && true; \
fi
RUN apt-get update
RUN apt-get install -y python3-full python3-pip
RUN apt-get install -y python3-boto3
COPY ./deploy_configuration/download-dump-instance-s3.py /
RUN chmod u+x /download-dump-instance-s3.py
RUN mkdir /scripts_to_init
COPY ./deploy_configuration/db /scripts_to_init
RUN chmod -R 777 /scripts_to_init
RUN mkdir /smile-database-data
RUN chmod -R 700 /smile-database-data
COPY ./deploy_configuration/run_sql.sh /docker-entrypoint-initdb.d/
RUN chmod u+x /docker-entrypoint-initdb.d/run_sql.sh
RUN apt-get update && apt-get install -y unzip
ENV HTTP_PROXY ""
ENV HTTPS_PROXY ""
ENV http_proxy ""
ENV https_proxy ""
RUN rm -f /etc/apt/apt.conf.d/05proxy
EXPOSE 5432