-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (29 loc) · 1.09 KB
/
Copy pathDockerfile
File metadata and controls
46 lines (29 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# syntax = docker/dockerfile:1
ARG NODE_VERSION=24.14.0
FROM node:${NODE_VERSION}-slim as base
LABEL fly_launch_runtime="Node.js"
WORKDIR /app
ENV NODE_ENV="production"
# Build stage
FROM base as build
COPY --link .npmrc package-lock.json package.json ./
RUN npm ci --include=dev
COPY --link . .
RUN mkdir /data && npm run build
RUN npm prune --omit=dev
# Final stage
FROM base
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y sqlite3 procps curl nano less ca-certificates && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
# Litestream for continuous database replication (see README → Automated backups)
ARG LITESTREAM_VERSION=0.5.14
ADD https://github.com/benbjohnson/litestream/releases/download/v${LITESTREAM_VERSION}/litestream-${LITESTREAM_VERSION}-linux-x86_64.deb /tmp/litestream.deb
RUN dpkg -i /tmp/litestream.deb && rm /tmp/litestream.deb
COPY --from=build /app /app
# Copy .sqliterc for convenient sqlite3 CLI usage
COPY --from=build /app/.sqliterc /root/.sqliterc
RUN mkdir -p /data
VOLUME /data
EXPOSE 3000
CMD ["node", "/app/scripts/start-app.js"]