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
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ public/build
build
dist
data
test
test
opensrc
.git
.github
18 changes: 1 addition & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@ jobs:

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false

- name: ⎔ Setup node
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'pnpm'

- name: Install dependencies
Expand All @@ -47,14 +43,10 @@ jobs:

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false

- name: ⎔ Setup node
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'pnpm'

- name: Install dependencies
Expand All @@ -72,14 +64,10 @@ jobs:

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false

- name: ⎔ Setup node
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'pnpm'

- name: Install dependencies
Expand All @@ -103,14 +91,10 @@ jobs:

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false

- name: ⎔ Setup node
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'pnpm'

- name: Install dependencies
Expand Down Expand Up @@ -169,7 +153,7 @@ jobs:
COMMIT_SHA=${{ github.sha }}
provenance: false
cache-from: type=gha
cache-to: type=gha,mode=min
cache-to: type=gha,mode=max

deploy:
name: 🚀 Deploy
Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24.14.0
52 changes: 31 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@
ARG NODE_VERSION=24.12.0
ARG PNPM_VERSION=10.26.2
ARG NODE_VERSION=24.14.0
ARG PNPM_VERSION=10.32.1

# base node image
FROM node:${NODE_VERSION}-slim AS base
# --- Build base: includes native build tools for better-sqlite3 ---
FROM node:${NODE_VERSION}-slim AS build-base

# Install dependencies and Atlas
RUN apt-get update \
&& apt-get install --no-install-recommends -y openssl openssh-client sqlite3 procps curl ca-certificates unzip vim build-essential python3 \
&& apt-get install --no-install-recommends -y openssl curl ca-certificates build-essential python3 \
&& apt-get clean \
&& npm i -g pnpm@${PNPM_VERSION} \
&& rm -rf /var/lib/apt/lists/*


# --- Runtime base: minimal packages for production ---
FROM node:${NODE_VERSION}-slim AS runtime-base

RUN apt-get update \
&& apt-get install --no-install-recommends -y openssl openssh-client sqlite3 procps curl ca-certificates unzip vim \
&& apt-get clean \
&& npm i -g pnpm@${PNPM_VERSION} \
&& curl -sSf https://atlasgo.sh | sh \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/*


# Install all node_modules, including dev dependencies
FROM base AS deps
# --- Install all node_modules (dev + prod) ---
FROM build-base AS deps

WORKDIR /upflow

COPY package.json pnpm-lock.yaml ./
RUN pnpm fetch


# Setup production node_modules
FROM base AS production-deps
# --- Production node_modules only ---
FROM build-base AS production-deps

ENV NODE_ENV production
ENV NODE_ENV=production
WORKDIR /upflow

COPY --from=deps /upflow/node_modules /upflow/node_modules
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --prod --offline --frozen-lockfile


# Build the app
FROM base AS build
# --- Build the app ---
FROM build-base AS build

WORKDIR /upflow

Expand All @@ -45,13 +55,13 @@ COPY . .
RUN pnpm run build


# Finally, build the production image with minimal footprint
FROM base
# --- Production image ---
FROM runtime-base

ENV DATABASE_URL "file:/upflow/data/data.db?connection_limit=1"
ENV UPFLOW_DATA_DIR "/upflow/data"
ENV PORT "8080"
ENV NODE_ENV "production"
ENV DATABASE_URL="file:/upflow/data/data.db?connection_limit=1"
ENV UPFLOW_DATA_DIR="/upflow/data"
ENV PORT="8080"
ENV NODE_ENV="production"

# add shortcut for connecting to database CLI
RUN printf '#!/bin/sh\nset -x\nsqlite3 file:/upflow/data/data.db\n' > /usr/local/bin/database-cli && chmod +x /usr/local/bin/database-cli
Expand All @@ -71,4 +81,4 @@ COPY --from=build /upflow/batch /upflow/batch
COPY --from=build /upflow/ops/remote /upflow/ops/remote
COPY --from=build /upflow/server.mjs /upflow/server.mjs

CMD [ "sh", "./start.sh" ]
CMD [ "sh", "./start.sh" ]
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
"vite-plugin-devtools-json": "1.0.0",
"vitest": "4.1.0"
},
"packageManager": "pnpm@10.32.1",
"pnpm": {
"onlyBuiltDependencies": [
"@biomejs/biome",
Expand Down