-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
144 lines (119 loc) · 4.27 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
FROM python:3.9-alpine as back_end
LABEL maintainer="Specify Collections Consortium <github.com/specify>"
RUN apk add --no-cache mysql-client
RUN addgroup -S specify -g 1001 && adduser -S specify -G specify -u 1001
USER specify
ARG LINK
ARG WORKING_LOCATION
ARG MYSQL_HOST
ARG MYSQL_USER
ARG MYSQL_PASSWORD
WORKDIR /home/specify
COPY requirements.txt .
RUN python3 -m venv venv \
&& venv/bin/pip install --no-cache-dir -r requirements.txt
COPY --chown=specify:specify taxa_tree_gbif taxa_tree_gbif
COPY --chown=specify:specify taxa_tree_itis taxa_tree_itis
COPY --chown=specify:specify taxa_tree_col taxa_tree_col
COPY --chown=specify:specify taxa_tree_worms taxa_tree_worms
COPY --chown=specify:specify taxa_tree_stats taxa_tree_stats
RUN echo -e \
"site_link = 'http://nginx/gbif/'" \
"\ntarget_dir = '/home/specify/taxa_tree_gbif_working_dir/'" \
"\nmysql_host = 'database'" \
"\nmysql_user = 'root'" \
"\nmysql_password = 'root'" \
>taxa_tree_gbif/back_end/config.py
RUN echo -e \
"<?php" \
"\ndefine('DEVELOPMENT', FALSE);" \
"\ndefine('LINK', '${LINK}gbif/');" \
"\ndefine('WORKING_LOCATION','/var/www/taxa_tree_gbif_working_dir/');" \
"\ndefine('STATS_URL', 'http://nginx/stats/collect/');" \
>taxa_tree_gbif/front_end/config/required.php
RUN echo -e \
"site_link = 'http://nginx/itis/'" \
"\ntarget_dir = '/home/specify/taxa_tree_itis_working_dir/'" \
"\nmysql_host = 'database'" \
"\nmysql_user = 'root'" \
"\nmysql_password = 'root'" \
>taxa_tree_itis/back_end/config.py
RUN echo -e \
"<?php" \
"\ndefine('DEVELOPMENT', FALSE);" \
"\ndefine('LINK', '${LINK}itis/');" \
"\ndefine('WORKING_LOCATION','/var/www/taxa_tree_itis_working_dir/');" \
"\ndefine('STATS_URL', 'http://nginx/stats/collect/');" \
>taxa_tree_itis/front_end/config/required.php
RUN echo -e \
"<?php" \
"\ndefine('DEVELOPMENT', FALSE);" \
"\ndefine('LINK', '${LINK}col/');" \
"\ndefine('WORKING_LOCATION','/var/www/taxa_tree_col_working_dir/');" \
"\ndefine('STATS_URL', 'http://nginx/stats/collect/');" \
>taxa_tree_col/front_end/config/required.php
RUN echo -e \
"site_link = 'http://nginx/col/'" \
"\ntarget_dir = '/home/specify/taxa_tree_col_working_dir/'" \
"\nmysql_host = 'database'" \
"\nmysql_user = 'root'" \
"\nmysql_password = 'root'" \
"\ndocker_container = ''" \
"\nmysql_command = 'mysql'" \
"\ndocker_dir = target_dir" \
>taxa_tree_col/back_end/config.py
RUN echo -e \
"<?php" \
"\ndefine('DEVELOPMENT', FALSE);" \
"\ndefine('LINK', '${LINK}worms/');" \
"\ndefine('WORKING_LOCATION','/var/www/taxa_tree_worms_working_dir/');" \
"\ndefine('STATS_URL', 'http://nginx/stats/collect/');" \
>taxa_tree_worms/front_end/config/required.php
RUN echo -e \
"site_link = 'http://nginx/worms/'" \
"\ntarget_dir = '/home/specify/taxa_tree_worms_working_dir/'" \
"\nmysql_database = 'worms'" \
"\nmysql_host = 'database'" \
"\nmysql_user = 'root'" \
"\nmysql_password = 'root'" \
"\ndocker_container = ''" \
"\nmysql_command = 'mysql'" \
"\ndocker_dir = target_dir" \
>taxa_tree_worms/back_end/config.py
RUN echo -e \
"<?php" \
"\ndefine('DEVELOPMENT', FALSE);" \
"\ndefine('LINK', '${LINK}stats/');" \
"\ndefine('WORKING_LOCATION','/var/www/taxa_tree_stats_working_dir/');" \
>taxa_tree_stats/config/required.php
COPY --chown=specify:specify docker-entrypoint.sh .
COPY --chown=specify:specify update-taxa.sh .
RUN mkdir \
taxa_tree_gbif_working_dir \
taxa_tree_itis_working_dir \
taxa_tree_col_working_dir \
taxa_tree_worms_working_dir \
taxa_tree_stats_working_dir \
&& chmod -R 777 \
taxa_tree_gbif_working_dir \
taxa_tree_itis_working_dir \
taxa_tree_col_working_dir \
taxa_tree_worms_working_dir \
taxa_tree_stats_working_dir
ENTRYPOINT ["./docker-entrypoint.sh"]
FROM php:7.4-fpm-alpine3.13 as front_end
LABEL maintainer="Specify Collections Consortium <github.com/specify>"
# Install zip PHP module
RUN apk add --no-cache libzip-dev \
&& docker-php-ext-install zip
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
RUN echo -e \
"\n\nmemory_limit = -1" \
"\nmax_execution_time = 3600" \
"\nbuffer-size=65535" \
"\noutput_buffering=65535" \
>>"$PHP_INI_DIR/php.ini"
RUN addgroup -S specify -g 1001 && adduser -S specify -G specify -u 1001
USER specify
WORKDIR /var/www/
CMD ["php-fpm"]