-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (55 loc) · 2.34 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
# VERSION 0.1
# AUTHOR: Nicholas Long <[email protected]>
# DESCRIPTION: Dockerfile for running BuildingSync Website
# TO_BUILD_AND_RUN: docker-compose build && docker-compose up
FROM alpine:3.10
RUN apk add --no-cache python3 \
python3-dev \
postgresql-dev \
alpine-sdk \
pcre \
pcre-dev \
libxslt-dev \
linux-headers \
bash \
bash-completion \
git \
nginx && \
ln -sf /usr/bin/python3 /usr/bin/python && \
python -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
ln -sf /usr/bin/pip3 /usr/bin/pip && \
pip install --upgrade pip setuptools && \
pip install git+https://github.com/Supervisor/supervisor@837c159ae51f3 && \
mkdir -p /var/log/supervisord/ && \
rm -r /root/.cache && \
addgroup -g 1000 uwsgi && \
adduser -G uwsgi -H -u 1000 -S uwsgi && \
mkdir -p /run/nginx && \
echo "daemon off;" >> /etc/nginx/nginx.conf && \
rm -f /etc/nginx/conf.d/default.conf && \
echo "gem: --no-rdoc --no-ri" > /etc/gemrc
## Note on some of the commands above:
## - create the uwsgi user and group to have id of 1000
## - copy over python3 as python
## - pip install --upgrade pip overwrites the pip so it is no longer a symlink
## - install supervisor that works with Python3.
WORKDIR /srv/buildingsync-website
COPY /requirements.txt /srv/buildingsync-website/requirements.txt
RUN pip install -r requirements.txt
WORKDIR /srv/buildingsync-website
### Copy over the remaining part of the application and some helpers
COPY . /srv/buildingsync-website/
### Copy the wait-for-it command to /usr/local
COPY /docker/wait-for-it.sh /usr/local/wait-for-it.sh
# nginx configurations - alpine doesn't use the sites-available directory. Put the buildingsync
# website configuration file into the /etc/nginx/conf.d/ folder.
COPY /docker/nginx.conf /etc/nginx/conf.d/buildingsync-website.conf
# Supervisor looks in /etc/supervisor for the configuration file.
COPY /docker/supervisord.conf /etc/supervisor/supervisord.conf
# entrypoint sets some permissions on directories that may be shared volumes
COPY /docker/buildingsync-website-entrypoint.sh /usr/local/bin/buildingsync-website-entrypoint
RUN chmod 775 /usr/local/bin/buildingsync-website-entrypoint
ENTRYPOINT ["buildingsync-website-entrypoint"]
CMD ["supervisord"]
EXPOSE 80