-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (32 loc) · 904 Bytes
/
Dockerfile
File metadata and controls
40 lines (32 loc) · 904 Bytes
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
# DOCKERFILE
# https://docs.docker.com/engine/reference/builder
# https://docs.docker.com/reference/dockerfile
# https://github.com/BretFisher/node-docker-good-defaults
# https://github.com/nodejs/docker-node#nodealpine
# dependencies
# INSTALL DEPENDENCIES
FROM oven/bun:1.2.12 AS dependencies
ENV HUSKY=0
WORKDIR /app
COPY package.json ./package.json
RUN bun install --production
# code
# COPY SERVER CODE
FROM dependencies AS code
WORKDIR /app
COPY src ./src
COPY tsconfig.json ./tsconfig.json
# runner
# RUN SERVER
FROM oven/bun:1.2.12 AS runner
ENV HOST=0.0.0.0
ENV HOSTNAME=localhost
ENV NODE_ENV=production
ENV PORT=4000
WORKDIR /app
COPY --from=code /app/src ./src
COPY --from=code /app/tsconfig.json ./tsconfig.json
COPY --from=dependencies /app/node_modules ./node_modules
COPY --from=dependencies /app/package.json ./package.json
EXPOSE $PORT 9229
CMD ["bun", "run", "./src/main.mts"]