fix dockerfile

This commit is contained in:
Egor 2026-01-17 01:20:09 -08:00
parent fed33b9c00
commit 332af80673
6 changed files with 32 additions and 9 deletions

3
.dockerignore Normal file
View file

@ -0,0 +1,3 @@
server/node_modules
proton-bridge/node_modules
node_modules

View file

@ -112,10 +112,22 @@ Your phone will now receive Signal notifications when ProtonMail receives new em
### Development
For local development, use the dev compose file to build from source:
For local development, install Bun and signal-cli:
```bash
docker compose -f docker-compose.dev.yml up -d
# Install Bun (use your package manager and this is a backup)
curl -fsSL https://bun.sh/install | bash
git clone https://github.com/lone-cloud/sup.git
cd sup
bun install
```
Then build and run with docker-compose.dev.yml:
```bash
docker compose -f docker-compose.dev.yml --profile protonmail up -d
```
Or run services directly with Bun:

View file

@ -1,6 +1,8 @@
services:
sup-server:
build: ./server
build:
context: .
dockerfile: server/Dockerfile
ports:
- '8080:8080'
environment:

View file

@ -16,7 +16,6 @@ const config =
: { name: 'sup-proton-bridge', path: './proton-bridge' };
try {
// Read version from package.json
const packageJson = await Bun.file(`${config.path}/package.json`).json();
const version = `v${packageJson.version}`;

View file

@ -2,19 +2,25 @@ FROM oven/bun:1.1.42-alpine AS builder
WORKDIR /app
COPY package.json bun.lock* ./
COPY server/package.json server/bun.lock* ./
RUN bun install --frozen-lockfile
COPY . .
COPY server .
RUN bun build --compile src/server.ts --outfile sup-server
RUN bun build --compile index.ts --outfile sup-server
FROM alpine:3.21
RUN apk add --no-cache openjdk21-jre
ARG SIGNAL_CLI_VERSION=0.13.22
RUN apk add --no-cache openjdk21-jre curl libstdc++ libgcc
RUN curl -L https://github.com/AsamK/signal-cli/releases/download/v${SIGNAL_CLI_VERSION}/signal-cli-${SIGNAL_CLI_VERSION}.tar.gz | tar xz -C /tmp \
&& mv /tmp/signal-cli-${SIGNAL_CLI_VERSION} /usr/local/signal-cli
COPY --from=builder /app/sup-server /usr/local/bin/sup-server
COPY --from=builder /app/signal-cli /usr/local/bin/signal-cli
ENV PATH="/usr/local/signal-cli/bin:${PATH}"
EXPOSE 8080

View file

@ -10,6 +10,7 @@
"chalk": "^5.6.2"
},
"scripts": {
"postinstall": "bun run ../scripts/install-signal-cli.ts || true",
"dev": "bun --watch index.ts",
"start": "bun run index.ts",
"build": "bun build --compile index.ts --outfile sup-server",