You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is no additional development, can it be deployed directly?
dockerFile
# ================================
# Build image
# ================================
FROM swift:5.3-xenial as build
# Install OS updates and, if needed, sqlite3
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y \
&& apt-get install -y libsqlite3-dev \
&& apt-get install -y zip \
&& rm -rf /var/lib/apt/lists/*
# Set up a build area
WORKDIR /build
# First just resolve dependencies.
# This creates a cached layer that can be reused
# as long as your Package.swift/Package.resolved
# files do not change.
COPY ./Package.* ./
RUN swift package resolve
# Copy entire repo into container
COPY . .
# Build everything, with optimizations and test discovery
RUN swift build --enable-test-discovery -c release
# Switch to the staging area
WORKDIR /staging
# Uncomment the next line if you need to load resources from the `Public` directory.
# Ensure that by default, neither the directory nor any of its contents are writable.
#
RUN mv /build/Public ./Public && chmod -R a-w ./Public
# Copy main executable to staging area
# We copy all needed Swift runtime libraries into this folder as well.
# We do this by checking which libraries are needed at runtime with the ldd command and copy only those that have swift in the name.
RUN cp "$(swift build --package-path /build -c release --show-bin-path)/Run" ./ \
&& ldd ./Run | grep swift | awk '{print $3}' | xargs cp -Lv -t ./ \
&& ln -s "Run" "bootstrap" \
&& zip --symlinks lambda.zip *
If there is no additional development, can it be deployed directly?
dockerFile
shell
The text was updated successfully, but these errors were encountered: