Skip to content

Commit

Permalink
fix: User Swift 5.9 Docker image (#53)
Browse files Browse the repository at this point in the history
* fix: Update to docker image to Swift 5.9

* nit

* nit

* update parse server to 6.3
  • Loading branch information
cbaker6 authored Oct 20, 2023
1 parent 54aa011 commit 0538fca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
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

0 comments on commit 0538fca

Please sign in to comment.