-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile
49 lines (39 loc) · 1.26 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
# ================================
# Build image
# ================================
FROM swift:5.7 as build
WORKDIR /build
# Copy required folders into container
COPY Sources Sources
COPY Tests Tests
COPY Resources Resources
COPY Package.swift Package.swift
# Compile with optimizations
RUN swift build \
--enable-test-discovery \
-c release \
-Xswiftc -g
# ================================
# Run image
# ================================
FROM swift:5.7
WORKDIR /SwiftTileserverCache
# Install imagemagick
RUN apt-get -y update && apt-get install -y imagemagick
# Install tippecanoe requirements
RUN apt-get -y update && apt-get -y install build-essential libsqlite3-dev zlib1g-dev
RUN git clone https://github.com/mapbox/tippecanoe.git -b 1.36.0 \
&& cd tippecanoe \
&& make -j \
&& make install \
&& rm -rf tippecanoe
# Install fontnik requirements
RUN apt-get -y update && apt-get -y install nodejs npm
# Install fontnik
RUN npm install -g [email protected]
# Copy build artifacts
COPY --from=build /build/.build/release /SwiftTileserverCache
# Copy Resources
COPY --from=build /build/Resources /SwiftTileserverCache/Resources
ENTRYPOINT ["./SwiftTileserverCacheApp"]
CMD ["serve", "--env", "production", "--log", "info", "--hostname", "0.0.0.0", "--port", "9000"]