-
Notifications
You must be signed in to change notification settings - Fork 28
/
Dockerfile
67 lines (57 loc) · 2.25 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
65
66
67
ARG BASE_IMAGE=alpine:3.12
FROM $BASE_IMAGE
ARG OCAML_VERSION=4.12.0
ARG UNISON_VERSION=2.52.1
ENV UNISON_ARGS ''
ENV UNISON_WATCH_ARGS ''
ENV APP_VOLUME '/app_sync'
ENV UNISON_SRC '/app_sync'
ENV UNISON_DEST '/host_sync'
RUN apk update \
&& apk add --no-cache --virtual .build-deps build-base curl git build-base coreutils \
&& curl -L http://caml.inria.fr/pub/distrib/ocaml-${OCAML_VERSION:0:4}/ocaml-${OCAML_VERSION}.tar.gz --output - | tar zxv -C /tmp \
&& cd /tmp/ocaml-${OCAML_VERSION} \
&& ./configure \
&& make world \
&& make opt \
&& umask 022 \
&& make install \
&& make clean \
&& apk del .build-deps \
&& rm -rf /tmp/ocaml-${OCAML_VERSION}
RUN apk update \
&& apk add --no-cache --virtual .build-deps build-base curl git build-base coreutils \
&& apk add --no-cache bash inotify-tools monit supervisor rsync ruby \
&& curl -L https://github.com/bcpierce00/unison/archive/v$UNISON_VERSION.tar.gz --output - | tar zxv -C /tmp \
&& cd /tmp/unison-${UNISON_VERSION} \
&& sed -i -e 's/GLIBC_SUPPORT_INOTIFY 0/GLIBC_SUPPORT_INOTIFY 1/' src/fsmonitor/linux/inotify_stubs.c \
&& make UISTYLE=text NATIVE=true STATIC=true \
&& cp src/unison src/unison-fsmonitor /usr/local/bin \
&& apk del binutils .build-deps \
&& apk add --no-cache libgcc libstdc++ \
&& rm -rf /tmp/unison-${UNISON_VERSION} \
&& apk add --no-cache --repository http://dl-4.alpinelinux.org/alpine/v3.12/testing/ shadow \
&& apk add --no-cache tzdata
# These can be overridden later
ENV TZ="Europe/Berlin" \
LANG="C.UTF-8" \
UNISON_DIR="/data" \
HOME="/root"
COPY entrypoint.sh /entrypoint.sh
COPY precopy_appsync.sh /usr/local/bin/precopy_appsync
COPY monitrc /etc/monitrc
RUN mkdir -p /docker-entrypoint.d \
&& chmod +x /entrypoint.sh \
&& mkdir -p /etc/supervisor.conf.d \
&& mkdir /unison \
&& chmod +x /usr/local/bin/precopy_appsync \
&& chmod u=rw,g=,o= /etc/monitrc
COPY supervisord.conf /etc/supervisord.conf
COPY supervisor.daemon.conf /etc/supervisor.conf.d/supervisor.daemon.conf
ENTRYPOINT ["/entrypoint.sh"]
CMD ["supervisord"]
############# ############# #############
############# /SHARED / #############
############# ############# #############
VOLUME /unison
EXPOSE 5000