-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 783 Bytes
/
Dockerfile
File metadata and controls
32 lines (23 loc) · 783 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
# use the official Bun image
# see all versions at https://hub.docker.com/r/oven/bun/tags
FROM oven/bun:1-debian AS base
# install dependencies into temp directory
# this will cache them and speed up future builds
FROM base AS install
RUN mkdir -p /temp/dev
COPY . /temp/dev/
RUN cd /temp/dev && HUSKY=0 bun install --frozen-lockfile
# install with --production (exclude devDependencies)
RUN bun build /temp/dev/index.ts --compile --outfile /temp/dev/bin/app
# copy production dependencies and source code into final image
FROM base AS release
RUN apt-get update && apt-get install -y \
ca-certificates \
curl
EXPOSE 8080/tcp
# run the app
# USER bun
WORKDIR /usr/src/app
COPY --from=install /temp/dev/bin/app .
COPY --from=install /temp/dev/config.json .
CMD [ "./app" ]