Skip to content

Commit 704373f

Browse files
committed
Initial Commit.
0 parents  commit 704373f

File tree

8 files changed

+695
-0
lines changed

8 files changed

+695
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# My K8s image
2+
FROM node:18-bookworm
3+
RUN mkdir -p /app && \
4+
chmod u+rwx /app && \
5+
chown node /app
6+
WORKDIR /app
7+
COPY . .
8+
RUN apt-get update && apt-get install -y cmake
9+
USER node
10+
CMD ["node", "/app/app.js"]
11+
12+
# Lambda Compatibility
13+
COPY --from=ghcr.io/rails-lambda/crypteia-extension-debian:1.1.2 /opt /opt
14+
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.7.0 /lambda-adapter /opt/extensions/lambda-adapter
15+
ENV LAMBDA_TASK_ROOT=/app

README.md

Whitespace-only changes.

app.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import express from "express";
2+
3+
const app = express();
4+
app.use(express.json());
5+
app.get("/", (_req, res, _next) => {
6+
res.send(`
7+
<h1>Hello Crypteia!</h1>
8+
<ul>
9+
<li>DB_URL: ${process.env.DB_URL}</li>
10+
<li>MY_KEY: ${process.env.MY_KEY}</li>
11+
</ul>
12+
`);
13+
});
14+
15+
app.listen(8080, () => {});
16+
export default app;

bin/build

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
set -e
3+
4+
VERSION="9"
5+
6+
docker build -t "demo-app-${VERSION}:latest" .
7+
8+
docker tag \
9+
"demo-app-${VERSION}:latest" \
10+
"589405201853.dkr.ecr.us-east-1.amazonaws.com/k8s:demo-app-${VERSION}"
11+
12+
docker push \
13+
"589405201853.dkr.ecr.us-east-1.amazonaws.com/k8s:demo-app-${VERSION}"
14+
15+
sam deploy \
16+
--parameter-overrides "Version=${VERSION}" \
17+
--capabilities "CAPABILITY_IAM" \
18+
--image-repository "589405201853.dkr.ecr.us-east-1.amazonaws.com/k8s" \
19+
--no-fail-on-empty-changeset \
20+
--region us-east-1 \
21+
--stack-name "crypteia-demo" \
22+
--template "template.yaml" \

0 commit comments

Comments
 (0)