forked from sfluo/tinybee.ai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
46 lines (35 loc) · 1.54 KB
/
Dockerfile.dev
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
FROM python:2.7-alpine
ENV REDIS_SENTINEL=redis-sentinel
ENV REDIS_MASTER=mymaster
# install git and various python library dependencies with alpine tools
RUN set -x && \
apk --no-cache add postgresql-dev g++ gcc git jpeg-dev libffi-dev libjpeg libxml2-dev libxslt-dev linux-headers musl-dev openssl zlib zlib-dev openldap-dev
ENV LIBRARY_PATH=/lib:/usr/lib
WORKDIR /opt/tinybee
ADD . /opt/tinybee
ADD pybossa/themes/tinybee/ /opt/tinybee/pybossa/themes/tinybee/
# install python dependencies with pip
RUN pip install -U pip setuptools && \
pip install -r /opt/tinybee/requirements.txt
# add unprivileged user for running the service
RUN addgroup tinybee && \
adduser -D -G tinybee -s /bin/sh -h /opt/tinybee tinybee && \
passwd -u tinybee
# variables in these files are modified with sed from /entrypoint.sh
ADD alembic.ini /opt/tinybee/
ADD settings_local.py /opt/tinybee/
# TODO: we shouldn't need write permissions on the whole folder
# Known files written during runtime:
# - /opt/tinybee/pybossa/themes/default/static/.webassets-cache
# - /opt/tinybee/alembic.ini and /opt/tinybee/settings_local.py (from entrypoint.sh)
RUN chown -R tinybee:tinybee /opt/tinybee
ADD entrypoint.sh /
RUN ["chmod", "+x", "/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]
# run with unprivileged user
USER tinybee
WORKDIR /opt/tinybee
EXPOSE 8080
# Background worker is also necessary and should be run from another copy of this container
# python app_context_rqworker.py scheduled_jobs super high medium low email maintenance
CMD ["python", "run.py"]