-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
47 lines (34 loc) · 828 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
35
36
37
38
39
40
41
42
43
44
45
46
47
# image for building bun
FROM oven/bun:alpine as builder
WORKDIR /app/
RUN apk add --no-cache python3-dev
RUN apk add --no-cache build-base
RUN apk add --no-cache coreutils
RUN apk add --no-cache pkgconf
RUN apk add --no-cache libtool
RUN apk add --no-cache make
RUN apk add --no-cache gcc
RUN apk add --no-cache clang
RUN apk add --no-cache libc-dev
RUN apk add --no-cache sqlite
# Copy app source
COPY . .
# install bun dependencies
RUN bun install
# run unit tests
# RUN bun test
# Build blob
RUN bun run build
# image for running bun
FROM oven/bun:alpine
WORKDIR /app/
# Copy blob
COPY --from=builder /app/dist/ .
# add non priviledged user
# RUN addgroup -S bot
# RUN adduser -S bot -G bot
# RUN chown -R bot:bot /app
# switch to non priviledged user
# USER bot
# start app
CMD [ "bun", "run", "main.js" ]