-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
45 lines (29 loc) · 1.09 KB
/
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
# ------------------------------------------------------------------------------
# Debug image
# ------------------------------------------------------------------------------
FROM denoland/deno:alpine-1.44.2 as debug
# 1. Source code will be copied to here.
WORKDIR /app
# 2. Run from this user.
USER deno
# 3. To improve build time, copy deps.ts, and cache the app dependencies.
COPY --chown=root:root ./deps.ts ./deps.ts
RUN deno cache --unstable ./deps.ts
# 4. Copy the app and cache it. Also cache all *.test.ts files if such are found.
COPY --chown=root:root . .
USER root
RUN chown deno deno.lock
USER deno
RUN find . -name '*.ts' | xargs --no-run-if-empty deno cache --unstable
CMD ["task", "start:debug"]
EXPOSE 8000
# ------------------------------------------------------------------------------
# Production image
# ------------------------------------------------------------------------------
FROM denoland/deno:distroless-1.44.2
WORKDIR /app
COPY --from=debug --chown=1993 /deno-dir /deno-dir
COPY --from=debug --chown=root:root /app .
#USER 1993
CMD ["task", "start"]
EXPOSE 8000