Skip to content

Commit be4aea2

Browse files
Adding files for Running locally with Uvicorn, previously living in a Gist.
1 parent ec4f2dd commit be4aea2

File tree

6 files changed

+65
-174
lines changed

6 files changed

+65
-174
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,8 @@ cython_debug/
135135
.idea
136136

137137
.vscode/
138+
139+
# Config files:
140+
src/.env
141+
docker-compose.yml
142+
Dockerfile

Dockerfile

Lines changed: 0 additions & 44 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,17 @@ Use the template on GitHub, create your repo, then:
2828
git clone https://github.com/<you>/<your-app>
2929
cd <your-app>
3030

31-
# NOTE (added by me):
32-
# Running locally with Uvicorn.
33-
# The .env and docker-compose.yml files were taken from this Gist:
34-
# https://gist.github.com/igorbenav/48ad745120c3f77817e094f3a609111a
35-
# I kept the local Dockerfile since it uses 'uv' instead of Poetry
36-
# (the Gist version relies on Poetry).
31+
# Running locally with Uvicorn:
3732

38-
# TODO: Decide where to put the example file, since it is currently
39-
# being copied from the Gist.
33+
# Copy Dockerfile and Docker Compose files:
34+
cp scripts/local_with_uvicorn/Dockerfile Dockerfile
35+
cp scripts/local_with_uvicorn/docker-compose.yml docker-compose.yml
4036

4137
# Copy and create your environment file
42-
cp src/.env.example src/.env
43-
# Fill in the minimal environment variables as described in the docs
38+
cp scripts/local_with_uvicorn/env src/.env
39+
# If you want, modify in the minimal environment variables as described in the docs.
4440

45-
# Run everything using Docker
41+
# Run everything using Docker:
4642
docker compose up
4743

4844
# Open the API documentation

docker-compose.test.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

docker-compose.yml

Lines changed: 0 additions & 111 deletions
This file was deleted.

scripts/local_with_uvicorn/env

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# ------------- app settings -------------
2+
APP_NAME="My Project"
3+
APP_DESCRIPTION="My Project Description"
4+
APP_VERSION="0.1"
5+
CONTACT_NAME="Me"
6+
CONTACT_EMAIL="[email protected]"
7+
LICENSE_NAME="MIT"
8+
9+
# ------------- database -------------
10+
POSTGRES_USER="postgres"
11+
POSTGRES_PASSWORD=1234
12+
POSTGRES_SERVER="db"
13+
POSTGRES_PORT=5432
14+
POSTGRES_DB="postgres"
15+
POSTGRES_ASYNC_PREFIX="postgresql+asyncpg://"
16+
17+
# ------------- crypt -------------
18+
SECRET_KEY=de2132a4a3a029d6a93a2aefcb519f0219990f92ca258a7c5ed938a444dbe1c8
19+
ALGORITHM=HS256
20+
ACCESS_TOKEN_EXPIRE_MINUTES=60
21+
22+
# ------------- admin -------------
23+
ADMIN_NAME="admin"
24+
ADMIN_EMAIL="[email protected]"
25+
ADMIN_USERNAME="admin"
26+
ADMIN_PASSWORD="Str1ngst!"
27+
28+
# ------------- redis cache -------------
29+
REDIS_CACHE_HOST="redis"
30+
REDIS_CACHE_PORT=6379
31+
32+
# ------------- redis queue -------------
33+
REDIS_QUEUE_HOST="redis"
34+
REDIS_QUEUE_PORT=6379
35+
36+
# ------------- redis rate limit -------------
37+
REDIS_RATE_LIMIT_HOST="redis"
38+
REDIS_RATE_LIMIT_PORT=6379
39+
40+
# ------------- client side cache -------------
41+
CLIENT_CACHE_MAX_AGE=60
42+
43+
# ------------- test -------------
44+
TEST_NAME="Tester User"
45+
TEST_EMAIL="[email protected]"
46+
TEST_USERNAME="testeruser"
47+
TEST_PASSWORD="Str1ng$t"
48+
49+
# ------------- environment -------------
50+
ENVIRONMENT="local"
51+
52+
# ------------- first tier -------------
53+
TIER_NAME="free"

0 commit comments

Comments
 (0)