forked from hypothesis/h
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (47 loc) · 1.57 KB
/
Copy pathDockerfile
File metadata and controls
58 lines (47 loc) · 1.57 KB
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
FROM gliderlabs/alpine:3.2
MAINTAINER Hypothes.is Project and contributors
# Update the base image and install runtime dependencies.
RUN apk update \
&& apk upgrade \
&& apk add ca-certificates libffi libpq python nodejs ruby
# Create the hypothesis user, group, home directory and package directory.
RUN addgroup -S hypothesis \
&& adduser -S -G hypothesis -h /var/lib/hypothesis hypothesis
WORKDIR /var/lib/hypothesis
# Copy packaging
COPY h/_version.py ./h/
COPY package.json setup.* requirements.txt versioneer.py ./
# These files must exist to satisfy setup.py.
RUN touch CHANGES.txt README.rst
# Install build dependencies, build, then clean up.
RUN apk add --virtual build-deps \
libffi-dev \
g++ \
make \
postgresql-dev \
python-dev \
ruby-dev \
&& apk add py-pip \
&& gem install --no-ri compass \
&& npm install --production \
&& pip install --no-cache-dir -U pip \
&& pip install --no-cache-dir -r requirements.txt \
&& apk del build-deps postgresql-dev \
&& npm cache clean \
&& rm -rf /tmp/* /var/cache/apk/*
# Copy the rest of the application files
COPY Procfile gunicorn.conf.py ./
COPY conf ./conf/
COPY h ./h/
# Change ownership of all the files and switch to the hypothesis user.
RUN chown -R hypothesis:hypothesis .
USER hypothesis
# Expose the default port.
EXPOSE 5000
# Persist the static directory.
VOLUME ["/var/lib/hypothesis/h/static"]
# Set the Python IO encoding to UTF-8.
ENV PYTHONIOENCODING utf_8
# Use honcho and start all the daemons by default.
ENTRYPOINT ["honcho"]
CMD ["start", "-c", "all=1,assets=0,initdb=0"]