Skip to content

Commit f5d4db4

Browse files
committed
2 parents 127898b + 83db416 commit f5d4db4

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

Dockerfile

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
1+
FROM python:3.11-alpine3.17 AS builder
2+
3+
WORKDIR /usr/src/app
4+
5+
RUN apk add --no-cache --virtual .build-deps \
6+
gcc musl-dev libffi-dev
7+
8+
COPY requirements.txt .
9+
10+
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
11+
112
FROM python:3.11-alpine3.17
2-
WORKDIR /usr/app
3-
COPY requirements.txt /usr/app/
4-
RUN pip install -r requirements.txt
13+
14+
WORKDIR /usr/src/app
15+
16+
RUN addgroup -S app && adduser -S app -G app
17+
USER app
18+
19+
COPY --from=builder /install /usr/local
20+
521
COPY . .
22+
623
EXPOSE 3000
7-
CMD [ "python", "app.py" ]
24+
25+
CMD ["python", "app.py"]

Terraform/modules/eks/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,17 @@ resource "aws_iam_role" "node" {
7979
resource "aws_iam_role_policy_attachment" "node_policy" {
8080
for_each = toset([
8181
"arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy",
82+
"arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy",
8283
"arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryPullOnly",
83-
"arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"
84+
"arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
8485
])
8586

8687
policy_arn = each.value
8788
role = aws_iam_role.node.name
8889
}
8990

9091

92+
9193
resource "aws_eks_node_group" "main" {
9294
for_each = var.node_groups
9395
cluster_name = aws_eks_cluster.main.name

Terraform/terraform.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public_subnet_cidrs = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"]
1313
cluster_name = "solar-system-app-cluster" # Changed from otel-cluster
1414
cluster_version = "1.30"
1515

16-
16+
1717
# Node Groups Configuration
1818
node_groups = {
1919
# Development/Testing - Small instances

0 commit comments

Comments
 (0)