Skip to content
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
6 changes: 6 additions & 0 deletions apps/backup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /out/backup ./apps/back
FROM postgres:18-alpine
COPY --from=build /out/backup /usr/local/bin/backup
ENV APP_ENV=production
# Each database's age scrypt step (packages/backup, work factor 18) allocates
# ~256 MiB that is garbage right after. Without a soft limit the GC lets the
# next database's allocation stack on it, and the 512 MiB container cap
# (deploy/platform/graph.go) kills the run on the second database. The limit
# makes the GC reclaim first; keep it below that cap.
ENV GOMEMLIMIT=384MiB
USER postgres
WORKDIR /tmp
# The postgres image's entrypoint would start a server: reset it. People run
Expand Down
2 changes: 1 addition & 1 deletion deploy/platform/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (config Config) backups(env string, appURL, adminURL map[string]any) []any
if adminURL != nil {
vars["ADMIN_DATABASE_URL"] = adminURL
}
const backupMemoryMB = 512 // pg_dump of a large table
const backupMemoryMB = 512 // pg_dump of a large table; apps/backup/Dockerfile GOMEMLIMIT stays below it
sc := railway.ServiceConfig{
"build": map[string]any{
"builder": "DOCKERFILE",
Expand Down
Loading