Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (43 loc) · 1.45 KB
/
Copy pathDockerfile
File metadata and controls
66 lines (43 loc) · 1.45 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM node:26-alpine AS builder
ARG PORT=60000
ENV PORT=${PORT}
ENV NODE_ENV=development
RUN apk update && \
apk upgrade --no-cache && \
apk add --no-cache bash ca-certificates sqlite && \
update-ca-certificates
SHELL ["/bin/bash", "-c"]
WORKDIR /app/
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
ENV PNPM_HOME=/root/.local/share/pnpm
ENV PATH="${PNPM_HOME}:${PNPM_HOME}/bin:/app/node_modules/.bin:${PATH}"
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.bashrc" SHELL="$(which bash)" bash - && \
pnpm i --frozen-lockfile
COPY . /app/
COPY .env /app/.env
ENV NODE_ENV=production
RUN mkdir -p /app/db && \
SEED=false pnpm build
###
FROM node:26-alpine
LABEL org.opencontainers.image.authors="EDM115 <docker@edm115.dev>"
LABEL org.opencontainers.image.base.name="node:26-alpine"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.source="https://github.com/EDM115/spendly.git"
LABEL org.opencontainers.image.title="Spendly"
LABEL org.opencontainers.image.url="https://github.com/EDM115/spendly"
ARG PORT=60000
ENV PORT=${PORT}
ENV NODE_ENV=production
RUN apk update && \
apk upgrade --no-cache && \
apk add --no-cache bash sqlite
SHELL ["/bin/bash", "-c"]
WORKDIR /app/
COPY package.json ./
COPY --from=builder /app/.output /app/.output
COPY --from=builder /app/drizzle /app/drizzle
RUN mkdir -p /app/db
VOLUME ["/app/db"]
EXPOSE ${PORT}
CMD ["node", "/app/.output/server/index.mjs"]