Containerfile
| 1 | FROM oven/bun:1 AS base |
| 2 | WORKDIR /app |
| 3 | |
| 4 | RUN apt-get --update install -y --no-install-recommends \ |
| 5 | tini openssh-client git-core zstd \ |
| 6 | && rm -rf /var/lib/apt/lists/* |
| 7 | |
| 8 | # Copy public first so postinstall can write vendor files into it |
| 9 | COPY public ./public |
| 10 | |
| 11 | # Install dependencies (postinstall vendors simplewebauthn + jxl-polyfill into public/) |
| 12 | COPY package.json bun.lock* ./ |
| 13 | RUN bun install --frozen-lockfile --production |
| 14 | |
| 15 | # Copy source |
| 16 | COPY src ./src |
| 17 | COPY tsconfig.json ./ |
| 18 | |
| 19 | EXPOSE 3000 |
| 20 | |
| 21 | ENV DATA_DIR=/data |
| 22 | VOLUME ["/data"] |
| 23 | |
| 24 | ENTRYPOINT ["/usr/bin/tini", "--"] |
| 25 | CMD ["sh", "-c", "bun run db:init && bun run start"] |
| 26 |