diff options
author | Vijay Aravamudhan <vraravam@users.noreply.github.com> | 2024-02-11 02:01:20 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-11 02:01:20 +0000 |
commit | 2fd7fa4e23835304fac6a433d0dc57c4b9fb26ff (patch) | |
tree | ed653f2757abeec7b81dd2cb85769ac25e9aa84d /Dockerfile | |
parent | Update submodules [skip ci] (diff) | |
download | ferdium-server-2fd7fa4e23835304fac6a433d0dc57c4b9fb26ff.tar.gz ferdium-server-2fd7fa4e23835304fac6a433d0dc57c4b9fb26ff.tar.zst ferdium-server-2fd7fa4e23835304fac6a433d0dc57c4b9fb26ff.zip |
upgrade pnpm and other deps (#98)
* Use fixed version of GHA ubuntu runner to avoid "moving target" issues
* Normalize GHA scripts parallel to ferdium-app repo
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -1,14 +1,19 @@ | |||
1 | FROM node:20.11.0-alpine as build | 1 | FROM node:20.11.0-alpine as builder |
2 | 2 | ||
3 | WORKDIR /server-build | 3 | WORKDIR /server-build |
4 | 4 | ||
5 | RUN apk add --no-cache python3 make gcc g++ libc-dev sqlite-dev | 5 | RUN apk add --no-cache python3 make gcc g++ libc-dev sqlite-dev |
6 | 6 | ||
7 | COPY . /server-build | ||
8 | |||
9 | ENV CI=true | 7 | ENV CI=true |
10 | RUN PNPM_VERSION=$(node -p 'require("./package.json").engines.pnpm'); npm i -g pnpm@$PNPM_VERSION | 8 | |
9 | COPY package*.json ./ | ||
10 | COPY .npmrc ./ | ||
11 | |||
12 | RUN npm i -gf "pnpm@$(node -p 'require("./package.json").engines.pnpm')" && pnpm -v | ||
11 | RUN pnpm install --config.build-from-source=sqlite --config.sqlite=/usr/local | 13 | RUN pnpm install --config.build-from-source=sqlite --config.sqlite=/usr/local |
14 | |||
15 | COPY . . | ||
16 | |||
12 | RUN pnpm build | 17 | RUN 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? |
21 | ENV HOST=0.0.0.0 PORT=3333 DATA_DIR="/data" | 26 | ENV HOST=0.0.0.0 PORT=3333 DATA_DIR="/data" |
22 | 27 | ||
28 | # TODO: Are all these packages needed for the runtime image? | ||
23 | RUN apk add --no-cache sqlite-libs curl su-exec python3 make g++ py3-pip git py3-pip sqlite | 29 | RUN 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 | 33 | COPY --from=builder /server-build /app | |
28 | COPY --from=build /server-build /app | ||
29 | RUN npm i -g @adonisjs/cli | 34 | RUN npm i -g @adonisjs/cli |
30 | 35 | ||
31 | HEALTHCHECK --start-period=5s --interval=30s --retries=5 --timeout=3s CMD curl -sSf http://localhost:${PORT}/health | 36 | HEALTHCHECK --start-period=5s --interval=30s --retries=5 --timeout=3s CMD curl -sSf http://localhost:${PORT}/health |