Skip to content

Commit aeb4aae

Browse files
Host on port 80
1 parent 7aaa237 commit aeb4aae

5 files changed

Lines changed: 10 additions & 8 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ COPY src/ ./src/
1010
RUN uv pip install --system -e .
1111

1212
# Run migrations and start server
13-
CMD ["uvicorn", "policyengine_api.main:app", "--host", "0.0.0.0", "--port", "8000"]
13+
CMD ["uvicorn", "policyengine_api.main:app", "--host", "0.0.0.0", "--port", "80"]

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ services:
2525

2626
api:
2727
build: .
28-
command: uvicorn policyengine_api.main:app --host 0.0.0.0 --port 8000 --reload
28+
command: uvicorn policyengine_api.main:app --host 0.0.0.0 --port 80 --reload
2929
ports:
30-
- "8000:8000"
30+
- "80:80"
3131
environment:
3232
SUPABASE_URL: ${SUPABASE_URL:-http://postgres:5432}
3333
SUPABASE_KEY: ${SUPABASE_KEY:-test-key}
@@ -45,7 +45,7 @@ services:
4545
redis:
4646
condition: service_healthy
4747
healthcheck:
48-
test: ["CMD", "python", "-c", "import httpx; exit(0 if httpx.get('http://localhost:8000/health', timeout=2).status_code == 200 else 1)"]
48+
test: ["CMD", "python", "-c", "import httpx; exit(0 if httpx.get('http://localhost:80/health', timeout=2).status_code == 200 else 1)"]
4949
interval: 5s
5050
timeout: 3s
5151
retries: 10

scripts/seed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def seed_model(model_version, session) -> TaxBenefitModelVersion:
142142

143143
def main():
144144
"""Main seed function."""
145-
console.print("[bold green]PolicyEngine Database Seeding[/bold green]\n")
145+
console.print("[bold green]PolicyEngine database seeding[/bold green]\n")
146146

147147
with next(get_quiet_session()) as session:
148148
# Seed UK model

src/policyengine_api/services/database.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from policyengine_api.config.settings import settings
55

66
engine = create_engine(settings.database_url, echo=settings.debug)
7+
# SQLAlchemy introspects the database schema on startup by querying pg_catalog
8+
# These queries are normal and only happen once per startup
79
logfire.instrument_sqlalchemy(engine=engine)
810

911

terraform/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ resource "aws_security_group" "ecs" {
232232
vpc_id = aws_vpc.main.id
233233

234234
ingress {
235-
from_port = 8000
236-
to_port = 8000
235+
from_port = 80
236+
to_port = 80
237237
protocol = "tcp"
238238
cidr_blocks = ["0.0.0.0/0"] # Allow direct access from internet (temporary until ALB is enabled)
239239
}
@@ -333,7 +333,7 @@ resource "aws_ecs_task_definition" "api" {
333333
essential = true
334334
portMappings = [
335335
{
336-
containerPort = 8000
336+
containerPort = 80
337337
protocol = "tcp"
338338
}
339339
]

0 commit comments

Comments
 (0)