Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ ENV PORT 8000
EXPOSE 8000
# ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION python
# Clean up apt cache and install keyring packages
# RUN rm -rf /var/lib/apt/lists/* && \
# apt-get clean && \
# apt-get -o Acquire::AllowInsecureRepositories=true update && \
# apt-get install -y --no-install-recommends --no-install-suggests \
# debian-keyring \
# debian-archive-keyring \
# gnupg \
# ca-certificates && \
# apt-get clean && \
# rm -rf /var/lib/apt/lists/*
RUN rm -rf /var/lib/apt/lists/* && \
apt-get clean && \
apt-get -o Acquire::AllowInsecureRepositories=true update && \
apt-get install -y --no-install-recommends --no-install-suggests \
debian-keyring \
debian-archive-keyring \
gnupg \
ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Now update and install dependencies including build tools
RUN apt-get update && \
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/ecs/ec2.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

resource "aws_instance" "ecs_instance" {
depends_on = [aws_ecs_cluster.graphbuilder_ecs_cluster, aws_iam_instance_profile.ecs_instance_profile]

# right now this ami is arm64
ami = var.ami_id # Replace with a valid ECS-optimized AMI
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/ecs/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ data "aws_caller_identity" "current" {}
# Define an IAM policy for CloudWatch logging with restricted permissions
resource "aws_iam_policy" "cloudwatch_logging_policy" {
name = "CloudWatchLoggingPolicy-${var.environment}"
description = "Allows Render EC2 instances to write logs to app's ec2 CloudWatch log group"
description = "Allows EC2 instances to write logs to app's ec2 CloudWatch log group"

policy = jsonencode({
Version = "2012-10-17",
Expand Down
21 changes: 21 additions & 0 deletions terraform/modules/ecs/service.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "aws_ecs_service" "frontend_service" {
name = "${var.project_name}-ecs-service-${var.environment}"
cluster = aws_ecs_cluster.graphbuilder_ecs_cluster.id
task_definition = aws_ecs_task_definition.graphbuilder_task.arn
desired_count = 1
launch_type = "EC2"

# Health check grace period for automatic restart
health_check_grace_period_seconds = 180

# Force new deployment when task definition changes
force_new_deployment = true

depends_on = [aws_ecs_task_definition.graphbuilder_task]

tags = {
Environment = var.environment
Project = var.project_name
Service = "graphbuilder"
}
}