-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathContainerfile
More file actions
38 lines (25 loc) · 806 Bytes
/
Containerfile
File metadata and controls
38 lines (25 loc) · 806 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
##
## Build stage
##
FROM docker.io/denoland/deno:latest AS build
## Deno cache folder
ENV DENO_DIR=/deno-dir/
# RUN deno upgrade canary && deno --version
ARG GIT_REVISION
ENV DENO_DEPLOYMENT_ID=${GIT_REVISION}
WORKDIR /app
COPY . .
RUN deno install --allow-scripts
RUN cd packages/frontend && deno task build
##
## Copy only built artifacts to run the final image
##
FROM docker.io/denoland/deno:latest
WORKDIR /app
COPY --from=build /app/packages/frontend/_fresh ./_fresh
RUN deno install --allow-scripts --entrypoint _fresh/server.js
EXPOSE 8000
CMD ["serve", "-A", "_fresh/server.js"]
## Health check works only with Docker Engine, not with Podman
# HEALTHCHECK --interval=30s --timeout=3s \
# CMD deno eval "try { await fetch('http://localhost:8000/health'); } catch { Deno.exit(1); }"