Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (37 loc) · 1.33 KB
/
Copy pathDockerfile
File metadata and controls
43 lines (37 loc) · 1.33 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
# The Sessionly server with the dashboard built in.
# docker build . the core server (Apache-2.0)
# docker build --target ee . with the Business and Enterprise features (LICENSE-EE)
FROM node:24-slim AS core
WORKDIR /app
RUN corepack enable
# Dependencies first, so they are cached until a package.json changes.
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages/schema/package.json packages/schema/
COPY apps/server/package.json apps/server/
COPY apps/web/package.json apps/web/
RUN pnpm install --frozen-lockfile
COPY schema schema
COPY packages packages
COPY apps apps
RUN pnpm build
# The release it is, from the release's tag (`--build-arg SESSIONLY_VERSION=v0.9.0`); "unreleased" without.
ARG SESSIONLY_VERSION=""
ENV SESSIONLY_VERSION=$SESSIONLY_VERSION
# Without DATABASE_URL the embedded database goes to /data: mount a volume there to keep it.
RUN mkdir /data && chown node:node /data
ENV HOST=0.0.0.0 PORT=8080 DATABASE_URL=file:/data/pglite
VOLUME /data
EXPOSE 8080
WORKDIR /app/apps/server
USER node
CMD ["node", "src/index.ts"]
# The same server with ee/ plugged in. Without a license it behaves like the core.
FROM core AS ee
USER root
COPY ee /app/ee
RUN cd /app && pnpm install --frozen-lockfile
WORKDIR /app/ee
USER node
CMD ["node", "src/main.ts"]
# A plain `docker build .` builds the core.
FROM core