Skip to content

fix: User Swift 5.9 Docker image #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ================================
# Build image
# ================================
FROM swift:5.7-jammy as build
FROM swift:5.9-jammy as build

# Install OS updates and, if needed, sqlite3
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
Expand All @@ -17,13 +17,18 @@ WORKDIR /build
# as long as your Package.swift/Package.resolved
# files do not change.
COPY ./Package.* ./
RUN swift package resolve
RUN swift package resolve --skip-update \
$([ -f ./Package.resolved ] && echo "--force-resolved-versions" || true)

# Copy entire repo into container
COPY . .

# Build everything, with optimizations
RUN swift build -c release --static-swift-stdlib
#RUN swift build -c release --static-swift-stdlib \
# Workaround for https://github.com/apple/swift/pull/68669
# This can be removed as soon as 5.9.1 is released, but is harmless if left in.
#-Xlinker -u -Xlinker _swift_backtrace_isThunkFunction

# Switch to the staging area
WORKDIR /staging
Expand All @@ -42,7 +47,7 @@ RUN [ -d /build/Resources ] && { mv /build/Resources ./Resources && chmod -R a-w
# ================================
# Run image
# ================================
FROM ubuntu:jammy
FROM swift:5.9-jammy-slim

# Make sure all system packages are up to date, and install only essential packages.
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
Expand Down
4 changes: 1 addition & 3 deletions Sources/App/entrypoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ enum Entrypoint {

let app = Application(env)

defer {
app.shutdown()
}
defer { app.shutdown() }

try await parseServerSwiftConfigure(app)
try await app.runFromAsyncMainEntrypoint()
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ services:
depends_on:
- parse
parse:
image: netreconlab/parse-hipaa:6.1.0-dashboard
image: netreconlab/parse-hipaa:6.3.0-dashboard
# Uncomment the image below to use Parse Server 5.4.0 instead. Be sure to comment out 6.0.0x
#image: netreconlab/parse-hipaa:5.4.0-dashboard
environment:
Expand Down