-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (36 loc) · 1.01 KB
/
Dockerfile
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
47
ARG NODE_VERSION=23.8.0
FROM node:${NODE_VERSION} AS base
WORKDIR /app
###############
# Dep Stage #
###############
FROM base AS deps
COPY package.json .
RUN npm install --omit-dev
###############
# Build Stage #
###############
FROM deps AS build
COPY . .
# Run DB migrations for SQLite
RUN npm run migrate
RUN npm install
RUN npm run build
###############
# Application #
###############
FROM base AS final
COPY package.json .
# Stuff needed by the app
COPY --from=build /app/build build/
COPY --from=build /app/prodServer.ts .
COPY --from=build /app/package.json .
COPY --from=build /app/src/lib/server/db src/lib/server/db
COPY --from=deps /app/node_modules node_modules/
ENV NODE_ENV=production
# Link to GitHub Repo & Other Metadata
LABEL org.opencontainers.image.source https://github.com/arithefirst/svchat
LABEL org.opencontainers.image.licenses GPL-3.0-only
LABEL org.opencontainers.image.description A simple chat app built with SvelteKit and Apache Cassandra
EXPOSE 3000
CMD ["npm", "run", "production"]