forked from marcel-dempers/docker-development-youtube-series
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0c8be9
commit dbacbff
Showing
6 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM aimvector/deno:1.0.0-buster-slim as build | ||
|
||
COPY ./src/ $DENO_DIR | ||
|
||
RUN mkdir /out/ | ||
RUN deno bundle /deno-dir/server.js /out/server.js | ||
|
||
FROM aimvector/deno:1.0.0-buster-slim as final | ||
|
||
COPY --from=build /out/server.js /deno-dir/server.js | ||
|
||
ENTRYPOINT ["deno"] | ||
CMD ["run", "--allow-net", "/deno-dir/server.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM debian:buster-slim | ||
|
||
ENV DENO_VERSION=1.0.0 | ||
|
||
RUN apt-get -qq update \ | ||
&& apt-get -qq install -y --no-install-recommends curl ca-certificates unzip \ | ||
&& curl -fsSL https://github.com/denoland/deno/releases/download/v${DENO_VERSION}/deno-x86_64-unknown-linux-gnu.zip \ | ||
--output deno.zip \ | ||
&& unzip deno.zip \ | ||
&& rm deno.zip \ | ||
&& chmod 777 deno \ | ||
&& mv deno /usr/bin/deno \ | ||
&& apt-get -qq remove --purge -y curl ca-certificates unzip \ | ||
&& apt-get -y -qq autoremove \ | ||
&& apt-get -qq clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
RUN useradd --uid 1993 --user-group deno \ | ||
&& mkdir /deno-dir/ \ | ||
&& chown deno:deno /deno-dir/ | ||
|
||
ENV DENO_DIR /deno-dir/ | ||
|
||
ENTRYPOINT ["deno"] | ||
CMD ["run", "https://deno.land/std/examples/welcome.ts"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: example-deploy | ||
labels: | ||
app: example-app | ||
annotations: | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: example-app | ||
replicas: 2 | ||
strategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 0 | ||
template: | ||
metadata: | ||
labels: | ||
app: example-app | ||
spec: | ||
containers: | ||
- name: example-app | ||
image: aimvector/deno-app:v1 | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 5000 | ||
resources: | ||
requests: | ||
memory: "64Mi" | ||
cpu: "10m" | ||
limits: | ||
memory: "256Mi" | ||
cpu: "500m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: example-service | ||
labels: | ||
app: example-app | ||
spec: | ||
type: LoadBalancer | ||
selector: | ||
app: example-app | ||
ports: | ||
- protocol: TCP | ||
name: http | ||
port: 80 | ||
targetPort: 5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM aimvector/deno:1.0.0-buster-slim as build | ||
|
||
COPY ./src/ $DENO_DIR | ||
|
||
ENTRYPOINT ["deno"] | ||
CMD ["run", "--allow-net", "/deno-dir/server.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { serve } from "https://deno.land/[email protected]/http/server.ts"; | ||
|
||
for await (const req of serve({ port: 5000 })) { | ||
req.respond({ body: "Hello World! - from Deno 1.0.0\n" }); | ||
} |