Create Dockerfile
Browse files- Dockerfile +21 -0
Dockerfile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM denoland/deno:2.3.3
|
| 2 |
+
|
| 3 |
+
# The port that your application listens to.
|
| 4 |
+
EXPOSE 8000
|
| 5 |
+
|
| 6 |
+
WORKDIR /app
|
| 7 |
+
|
| 8 |
+
# Prefer not to run as root.
|
| 9 |
+
USER deno
|
| 10 |
+
|
| 11 |
+
# Cache the dependencies as a layer (the following two steps are re-run only when deps.ts is modified).
|
| 12 |
+
# Ideally cache deps.ts will download and compile _all_ external files used in main.ts.
|
| 13 |
+
COPY deps.ts .
|
| 14 |
+
RUN deno install --entrypoint deps.ts
|
| 15 |
+
|
| 16 |
+
# These steps will be re-run upon each file change in your working directory:
|
| 17 |
+
COPY . .
|
| 18 |
+
# Compile the main app so that it doesn't need to be compiled each startup/entry.
|
| 19 |
+
RUN deno cache main.ts
|
| 20 |
+
|
| 21 |
+
CMD ["run", "--allow-net", "main.ts"]
|