Autogenerated from git://github.com/vapor/template.git@6563d51d1e3ec82e8739269df14bc9b9c01fb939

This commit is contained in:
Penny[bot] 2023-09-24 10:20:27 +00:00
parent 03e083ddd7
commit 6b406cb58a
3 changed files with 21 additions and 9 deletions

View File

@ -1,9 +1,9 @@
# ================================
# Build image
# ================================
FROM swift:5.8-jammy as build
FROM swift:5.9-jammy as build
# Install OS updates and, if needed, sqlite3
# Install OS updates
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y\
@ -17,13 +17,17 @@ 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
@ -42,7 +46,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 \
@ -66,6 +70,9 @@ WORKDIR /app
# Copy built executable and any staged resources from builder
COPY --from=build --chown=vapor:vapor /staging /app
# Provide configuration needed by the built-in crash reporter and some sensible default behaviors.
ENV SWIFT_ROOT=/usr SWIFT_BACKTRACE=enable=yes,sanitize=yes,threads=all,images=all,interactive=no
# Ensure all further commands run as the vapor user
USER vapor:vapor

View File

@ -1,4 +1,4 @@
// swift-tools-version:5.8
// swift-tools-version:5.9
import PackageDescription
let package = Package(
@ -8,7 +8,7 @@ let package = Package(
],
dependencies: [
// 💧 A server-side Swift web framework.
.package(url: "https://github.com/vapor/vapor.git", from: "4.77.1"),
.package(url: "https://github.com/vapor/vapor.git", from: "4.83.1"),
// 🗄 An ORM for SQL and NoSQL databases.
.package(url: "https://github.com/vapor/fluent.git", from: "4.8.0"),
// 🐘 Fluent driver for Postgres.
@ -20,12 +20,17 @@ let package = Package(
dependencies: [
.product(name: "Fluent", package: "fluent"),
.product(name: "FluentPostgresDriver", package: "fluent-postgres-driver"),
.product(name: "Vapor", package: "vapor")
.product(name: "Vapor", package: "vapor"),
]
),
.testTarget(name: "AppTests", dependencies: [
.target(name: "App"),
.product(name: "XCTVapor", package: "vapor"),
// Workaround for https://github.com/apple/swift-package-manager/issues/6940
.product(name: "Vapor", package: "vapor"),
.product(name: "Fluent", package: "Fluent"),
.product(name: "FluentPostgresDriver", package: "fluent-postgres-driver"),
])
]
)

View File

@ -62,7 +62,7 @@ services:
deploy:
replicas: 0
db:
image: postgres:15-alpine
image: postgres:16-alpine
volumes:
- db_data:/var/lib/postgresql/data/pgdata
environment: