on master help sign in
WebSocketTest/web.Dockerfile
29 lines 986 B history raw
1# You can set the Swift version to what you need for your app. Versions can be found here: https://hub.docker.com/_/swift
2FROM swift:4.2 as builder
4# For local build, add `--build-arg environment=local`
5ARG env=""
6ENV ENVIRONMENT=$env
8RUN apt-get -qq update && apt-get -q -y install \
9 tzdata \
10 && rm -r /var/lib/apt/lists/*
11WORKDIR /app
12COPY . .
13RUN mkdir -p /build/lib && cp -R /usr/lib/swift/linux/*.so /build/lib
14RUN swift build -c release && mv `swift build -c release --show-bin-path` /build/bin
16# Production image
17FROM ubuntu:16.04
18RUN apt-get -qq update && apt-get install -y \
19 libicu55 libxml2 libbsd0 libcurl3 libatomic1 \
20 tzdata \
21 && rm -r /var/lib/apt/lists/*
22WORKDIR /app
23COPY --from=builder /build/bin/Run .
24COPY --from=builder /build/lib/* /usr/lib/
25COPY --from=builder /app/Public ./Public
26# Uncommand the next line if you are using Leaf
27#COPY --from=builder /app/Resources ./Resources
29ENTRYPOINT ./Run serve --env $ENVIRONMENT --hostname 0.0.0.0 --port 80