forked from matrix-org/matrix-appservice-irc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (30 loc) · 1.03 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
# Freebind build
# node:12-slim uses debian:stretch-slim as a base, so it's safe to build on here.
FROM debian:stretch-slim as freebind
RUN apt-get update \
&& apt-get install -y git build-essential
RUN git clone https://github.com/matrix-org/freebindfree.git
RUN cd freebindfree && make
# Typescript build
FROM node:12-slim as builder
WORKDIR /build
RUN apt-get update && apt-get install -y git python3 libicu-dev build-essential
COPY src/ /build/src/
COPY types/ /build/types/
COPY .eslintrc *json /build/
RUN npm ci
RUN npm run build
# App
FROM node:12-slim
RUN apt-get update && apt-get install -y sipcalc iproute2 openssl --no-install-recommends
RUN rm -rf /var/lib/apt/lists/*
RUN mkdir app
WORKDIR /app
RUN mkdir ./data
COPY --from=freebind /freebindfree/libfreebindfree.so /app/libfreebindfree.so
COPY --from=builder /build/node_modules /app/node_modules
COPY --from=builder /build/lib /app/lib
COPY app.js config.schema.yml /app/
COPY docker /app/docker
ENV LD_PRELOAD /app/libfreebindfree.so
ENTRYPOINT ["/app/docker/start.sh"]