Skip to content

Commit 2f571ed

Browse files
committed
chore: reduce container size to 1/3rds
1 parent 35f9538 commit 2f571ed

2 files changed

Lines changed: 10 additions & 15 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ lerna-debug.log*
3737
# Sentry Config File
3838
.sentryclirc
3939
lgtm
40+
sync

Dockerfile

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
1-
FROM denoland/deno:latest
1+
FROM denoland/deno:alpine AS builder
22

33
WORKDIR /app
44
COPY deno.json deno.lock .
55
RUN deno install --frozen
66
COPY . .
77
RUN deno compile --allow-env --allow-run --allow-net --allow-read --deny-sys -o sync main.ts
88

9-
FROM debian:12-slim
9+
FROM denoland/deno:alpine AS runner
1010

1111
WORKDIR /app
1212

13-
ENV DEBIAN_FRONTEND=noninteractive
13+
# Install PostgreSQL client
14+
RUN apk add --no-cache postgresql-client
1415

15-
RUN apt-get update && apt-get install -y wget lsb-release gnupg2 postgresql-client-common
16-
17-
# Add PostgreSQL repository
18-
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' \
19-
&& wget -qO - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
20-
21-
# Install pg_dump for PostgreSQL 17
22-
RUN apt-get update && apt-get install -y \
23-
postgresql-client-17 \
24-
&& rm -rf /var/lib/apt/lists/*
25-
ENV PG_DUMP_BINARY=/bin/pg_dump
16+
ENV PG_DUMP_BINARY=/usr/bin/pg_dump
2617
COPY bin ./bin
27-
COPY --from=0 /app/sync /app/sync
18+
COPY --from=builder /app/sync /app/sync
19+
20+
USER deno
21+
EXPOSE 2345
2822

2923
CMD ["/app/sync"]

0 commit comments

Comments
 (0)