This repository has been archived by the owner on Feb 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Dockerfile-nginx
55 lines (33 loc) · 1.6 KB
/
Dockerfile-nginx
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
FROM nginx:1
LABEL maintainer "Nazar Mokrynskyi <[email protected]>"
COPY webserver-common /webserver-common/
RUN \
/webserver-common/create-git-user.sh && \
/webserver-common/apt-get-update.sh && \
/webserver-common/apt-get-install-common.sh && \
/webserver-common/apt-get-install-ceph-fuse.sh && \
/webserver-common/apt-get-cleanup.sh && \
# Run in foreground (let's specify it config file, since dealing with parameters that contain spaces is more difficult than we'd like it to be)
echo "daemon off;\n$(cat /etc/nginx/nginx.conf)" > /etc/nginx/nginx.conf && \
# Change Nginx user
sed -i 's/user nginx;/user git;/g' /etc/nginx/nginx.conf && \
# Make Nginx work with PHP with default config
sed -i 's/127.0.0.1:9000/php:9000/g' /etc/nginx/conf.d/default.conf && \
sed -i 's/\/scripts$fastcgi_script_name/$document_root$fastcgi_script_name/g' /etc/nginx/conf.d/default.conf && \
# We'll keep configs in /data/nginx/config
sed -i 's/\/etc\/nginx/\/data\/nginx\/config/g' `find /etc/nginx -type f` && \
# We'll keep logs in /data/nginx/log if CephFS is not used and local directory otherwise
sed -i 's/\/var\/log\/nginx/\/data\/nginx\/log/g' `find /etc/nginx -type f` && \
# We'll keep data in /data/nginx/www
sed -i 's/\/usr\/share\/nginx\/html/\/data\/nginx\/www/g' `find /etc/nginx -type f` && \
sed -i 's/root html/root \/data\/nginx\/www/g' /etc/nginx/conf.d/default.conf && \
mv /etc/nginx /etc/nginx_dist
COPY nginx/webserver-entrypoint.sh /
VOLUME \
/data \
/tmp
ENV \
CEPH_MON_SERVICE=ceph-mon \
CEPHFS_MOUNT=0
ENTRYPOINT ["/webserver-entrypoint.sh"]
CMD ["nginx"]