-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
86 lines (79 loc) · 3.41 KB
/
Dockerfile
File metadata and controls
86 lines (79 loc) · 3.41 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
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
FROM xavren/ubuntu-s6-base
MAINTAINER contact@xavren.ovh
RUN apt-get update && apt-get -y install python-software-properties\
git \
mercurial \
wget \
supervisor \
mysql-client \
python \
python-dev \
python-pip \
python3-setuptools \
build-essential \
libmysqlclient-dev \
gcc \
g++ \
language-pack-en \
libzmq-dev \
libxml2-dev \
libxslt-dev \
lib32z1-dev \
libffi-dev \
libssl-dev \
pkg-config \
python-lxml \
tmux \
curl \
tnef \
stow \
sudo \
lua5.2 \
liblua5.2-dev \
unzip \
&& apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN mkdir -p /tmp/build
WORKDIR /tmp/build
ENV LIBSODIUM_VER=1.0.0
RUN curl -L -O https://github.com/jedisct1/libsodium/releases/download/${LIBSODIUM_VER}/libsodium-${LIBSODIUM_VER}.tar.gz
RUN echo 'ced1fe3d2066953fea94f307a92f8ae41bf0643739a44309cbe43aa881dbc9a5 *libsodium-1.0.0.tar.gz' | sha256sum -c || exit 1
RUN tar -xzf libsodium-${LIBSODIUM_VER}.tar.gz
WORKDIR /tmp/build/libsodium-1.0.0
RUN ./configure --prefix=/usr/local/stow/libsodium-${LIBSODIUM_VER} &&\
make -j4 &&\
rm -rf /usr/local/stow/libsodium-${LIBSODIUM_VER} &&\
mkdir -p /usr/local/stow/libsodium-${LIBSODIUM_VER} &&\
make install &&\
stow -d /usr/local/stow -R libsodium-${LIBSODIUM_VER} &&\
ldconfig
WORKDIR /tmp/build
RUN rm -rf libsodium-${LIBSODIUM_VER} libsodium-${LIBSODIUM_VER}.tar.gz &&\
pip install 'pip>=9.0.1' 'setuptools>=5.3' && hash pip && pip install 'pip>=9.0.1' 'setuptools>=5.3' tox &&\
rm -rf /usr/lib/python2.7/dist-packages/setuptools.egg-info
WORKDIR /opt
ENV LC_ALL=en_US.UTF-8
ENV LANF=en_US.UTF-8
ENV TAG=17.1.6
RUN curl -L -O https://github.com/nylas/sync-engine/archive/${TAG}.zip && unzip ${TAG}.zip && rm ${TAG}.zip && mv sync-engine-${TAG} sync-engine
WORKDIR /opt/sync-engine
# RUN find . -name \*.pyc -delete &&\
RUN sed -i "s/.*imapclient*/imapclient==1.0.2/g" requirements.txt
RUN pip install -r requirements.txt && pip install -e . && \
useradd inbox && \
mkdir -p /etc/inboxapp
ADD config.json /etc/inboxapp/config-env.json
ADD secrets.yml /etc/inboxapp/secrets-env.yml
RUN chmod 0644 /etc/inboxapp/config-env.json && chmod 0600 /etc/inboxapp/secrets-env.yml && chown -R inbox:inbox /etc/inboxapp
RUN apt-get -y autoremove && apt-get clean &&\
mkdir -p /var/lib/inboxapp/parts && mkdir -p /var/log/inboxapp && chown inbox:inbox /var/log/inboxapp &&\
chown -R inbox:inbox /var/lib/inboxapp && chown -R inbox:inbox /opt/sync-engine
RUN mkdir -p /etc/s6/inbox-start && mkdir -p /etc/s6/inbox-api
ADD s6-inbox-start.sh /etc/s6/inbox-start/run
ADD s6-inbox-api.sh /etc/s6/inbox-api/run
RUN chmod o+x /etc/s6/inbox-start/run && chmod o+x /etc/s6/inbox-api/run &&\
ln -s /usr/bin/s6-finish /etc/s6/inbox-start/finish &&\
ln -s /usr/bin/s6-finish /etc/s6/inbox-api/finish
WORKDIR /opt/sync-engine/
VOLUME /var/lib/inboxapp
EXPOSE 5555
ENV PYTHONPATH=/opt/sync-engine