aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile17
1 files changed, 11 insertions, 6 deletions
diff --git a/Dockerfile b/Dockerfile
index df1c96a..d865ce1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,14 +1,19 @@
1FROM node:20.11.0-alpine as build 1FROM node:20.11.0-alpine as builder
2 2
3WORKDIR /server-build 3WORKDIR /server-build
4 4
5RUN apk add --no-cache python3 make gcc g++ libc-dev sqlite-dev 5RUN apk add --no-cache python3 make gcc g++ libc-dev sqlite-dev
6 6
7COPY . /server-build
8
9ENV CI=true 7ENV CI=true
10RUN PNPM_VERSION=$(node -p 'require("./package.json").engines.pnpm'); npm i -g pnpm@$PNPM_VERSION 8
9COPY package*.json ./
10COPY .npmrc ./
11
12RUN npm i -gf "pnpm@$(node -p 'require("./package.json").engines.pnpm')" && pnpm -v
11RUN pnpm install --config.build-from-source=sqlite --config.sqlite=/usr/local 13RUN pnpm install --config.build-from-source=sqlite --config.sqlite=/usr/local
14
15COPY . .
16
12RUN pnpm build 17RUN pnpm build
13 18
14# ---- RUNTIME IMAGE ---------------------------------------------------------- 19# ---- RUNTIME IMAGE ----------------------------------------------------------
@@ -20,12 +25,12 @@ LABEL maintainer="ferdium"
20# TODO: Shouldn't we set 'NODE_ENV=production' when running in production mode? 25# TODO: Shouldn't we set 'NODE_ENV=production' when running in production mode?
21ENV HOST=0.0.0.0 PORT=3333 DATA_DIR="/data" 26ENV HOST=0.0.0.0 PORT=3333 DATA_DIR="/data"
22 27
28# TODO: Are all these packages needed for the runtime image?
23RUN apk add --no-cache sqlite-libs curl su-exec python3 make g++ py3-pip git py3-pip sqlite 29RUN apk add --no-cache sqlite-libs curl su-exec python3 make g++ py3-pip git py3-pip sqlite
24# The next command is needed for sqlite3 install command executed by node-gyp 30# The next command is needed for sqlite3 install command executed by node-gyp
25# RUN ln -s /usr/bin/python3 /usr/bin/python 31# RUN ln -s /usr/bin/python3 /usr/bin/python
26 32
27 33COPY --from=builder /server-build /app
28COPY --from=build /server-build /app
29RUN npm i -g @adonisjs/cli 34RUN npm i -g @adonisjs/cli
30 35
31HEALTHCHECK --start-period=5s --interval=30s --retries=5 --timeout=3s CMD curl -sSf http://localhost:${PORT}/health 36HEALTHCHECK --start-period=5s --interval=30s --retries=5 --timeout=3s CMD curl -sSf http://localhost:${PORT}/health