/
Dockerfile
34 lines (25 loc) 路 957 Bytes
/
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
FROM swift:5.9.2 as build
RUN apt-get --fix-missing update
RUN apt-get install -y build-essential cmake libpq-dev libssl-dev libz-dev openssl python-is-python3
WORKDIR /build
COPY Package.resolved .
COPY Package.swift .
COPY Sources ./Sources
COPY Tests ./Tests
RUN git clone https://github.com/commonmark/cmark \
&& cd cmark \
&& git checkout 1880e6535e335f143f9547494def01c13f2f331b
RUN make -C cmark INSTALL_PREFIX=/usr
RUN make -C cmark install
RUN swift build -j 1 --configuration release --product Server -Xswiftc -g \
&& swift build -j 1 --configuration release --product Runner -Xswiftc -g
FROM swift:5.9.2-slim
RUN apt-get update
RUN apt-get install -y libpq-dev libssl-dev libz-dev openssl
WORKDIR /app
COPY --from=build /usr/include/cmark* /usr/include/
COPY --from=build /usr/lib/libcmark* /usr/lib/
COPY --from=build /build .
RUN ln -s /app/.build/release/Server /usr/bin
RUN ln -s /app/.build/release/Runner /usr/bin
CMD Server