-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
34 lines (25 loc) · 988 Bytes
/
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
#FROM oven/bun:1.1.4 as base
FROM node:20 as base
RUN useradd -m -u 1001 -s /bin/bash bun
# install bun from here curl -fsSL https://bun.sh/install | bash
RUN curl -fsSL https://bun.sh/install | bash && \
ln -s $HOME/.bun/bin/bun /usr/local/bin/bun
WORKDIR /usr/src/Yuuko
FROM base AS install
RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production
FROM base AS prerelease
COPY . .
ENV NODE_ENV docker
FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /usr/src/Yuuko/src ./src
COPY --from=prerelease /usr/src/Yuuko/entrypoint.sh .
COPY --from=prerelease /usr/src/Yuuko/package.json .
COPY --from=prerelease /usr/src/Yuuko/tsconfig.json .
COPY --from=prerelease /usr/src/Yuuko/drizzle.config.ts .
COPY --from=prerelease /usr/src/Yuuko/drizzle.stats.config.ts .
EXPOSE 3030/tcp
VOLUME "usr/src/Yuuko/database/sqlite"
ENTRYPOINT [ "sh", "entrypoint.sh" ]