-
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.
Merge branch 'main' into mvt-pmtiles-api
- Loading branch information
Showing
12 changed files
with
279 additions
and
79 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 |
---|---|---|
|
@@ -70,3 +70,4 @@ scratch/ | |
PG:* | ||
|
||
*.dev | ||
sample_data/* |
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
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,2 @@ | ||
NEXT_PUBLIC_API_URL=http://localhost:8000 | ||
NEXT_PUBLIC_S3_BUCKET_URL=https://pub-fa71193941a74e14a38eee99f30f53d9.r2.dev |
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,20 @@ | ||
# Use official Node.js image as the base image | ||
FROM node:18-alpine | ||
|
||
# Set working directory inside the container | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json to install dependencies first | ||
COPY package.json package-lock.json ./ | ||
|
||
# Install dependencies | ||
RUN npm install | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Expose the Next.js dev server port | ||
EXPOSE 3000 | ||
|
||
# Start the Next.js application in development mode | ||
CMD ["npm", "run", "dev"] |
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
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
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
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
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,19 @@ | ||
# Backend | ||
DOMAIN=localhost | ||
ENVIRONMENT=local | ||
PROJECT_NAME="Districtr v2 backend" | ||
BACKEND_CORS_ORIGINS="http://localhost,http://localhost:5173,http://localhost:3000,http://127.0.0.1:3000" | ||
SECRET_KEY="super-secret" | ||
|
||
# Postgres | ||
DATABASE_URL=postgresql+psycopg://postgres:postgres@db:5432/districtr | ||
POSTGRES_SCHEME=postgresql+psycopg | ||
POSTGRES_USER=postgres | ||
POSTGRES_PASSWORD=postgres | ||
POSTGRES_DB=districtr | ||
POSTGRES_SERVER=db # Use the service name `db` from docker-compose | ||
POSTGRES_PORT=5432 | ||
|
||
# Volumes | ||
VOLUME_PATH=/data | ||
|
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,20 @@ | ||
# Use official Python image with version >= 3.11 | ||
FROM python:3.12-slim | ||
|
||
# Set working directory inside the container | ||
WORKDIR /districtr-backend | ||
|
||
# Copy requirements file first and install dependencies | ||
COPY requirements.txt . | ||
|
||
# Install Python dependencies | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the rest of the backend code into the container | ||
COPY . . | ||
|
||
# Install PostGIS extension and PostgreSQL client for database operations | ||
RUN apt-get update && apt-get install -y postgresql-client libpq-dev gdal-bin | ||
|
||
# Command to run the server | ||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--reload"] |
Oops, something went wrong.