Skip to content

Commit ef92ddd

Browse files
first commit
0 parents  commit ef92ddd

64 files changed

Lines changed: 3991 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
### Python template
2+
3+
deploy/
4+
.idea/
5+
.vscode/
6+
.git/
7+
# Byte-compiled / optimized / DLL files
8+
__pycache__/
9+
*.py[cod]
10+
*$py.class
11+
12+
# C extensions
13+
*.so
14+
15+
# Distribution / packaging
16+
.Python
17+
build/
18+
develop-eggs/
19+
dist/
20+
downloads/
21+
eggs/
22+
.eggs/
23+
lib/
24+
lib64/
25+
parts/
26+
sdist/
27+
var/
28+
wheels/
29+
share/python-wheels/
30+
*.egg-info/
31+
.installed.cfg
32+
*.egg
33+
MANIFEST
34+
35+
# PyInstaller
36+
# Usually these files are written by a python script from a template
37+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38+
*.manifest
39+
*.spec
40+
41+
# Installer logs
42+
pip-log.txt
43+
pip-delete-this-directory.txt
44+
45+
# Unit test / coverage reports
46+
htmlcov/
47+
.tox/
48+
.nox/
49+
.coverage
50+
.coverage.*
51+
.cache
52+
nosetests.xml
53+
coverage.xml
54+
*.cover
55+
*.py,cover
56+
.hypothesis/
57+
.pytest_cache/
58+
cover/
59+
60+
# Translations
61+
*.mo
62+
*.pot
63+
64+
# Django stuff:
65+
*.log
66+
local_settings.py
67+
db.sqlite3
68+
db.sqlite3-journal
69+
70+
# Flask stuff:
71+
instance/
72+
.webassets-cache
73+
74+
# Scrapy stuff:
75+
.scrapy
76+
77+
# Sphinx documentation
78+
docs/_build/
79+
80+
# PyBuilder
81+
.pybuilder/
82+
target/
83+
84+
# Jupyter Notebook
85+
.ipynb_checkpoints
86+
87+
# IPython
88+
profile_default/
89+
ipython_config.py
90+
91+
# pyenv
92+
# For a library or package, you might want to ignore these files since the code is
93+
# intended to run in multiple environments; otherwise, check them in:
94+
# .python-version
95+
96+
# pipenv
97+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
98+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
99+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
100+
# install all needed dependencies.
101+
#Pipfile.lock
102+
103+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
104+
__pypackages__/
105+
106+
# Celery stuff
107+
celerybeat-schedule
108+
celerybeat.pid
109+
110+
# SageMath parsed files
111+
*.sage.py
112+
113+
# Environments
114+
.env
115+
.venv
116+
env/
117+
venv/
118+
ENV/
119+
env.bak/
120+
venv.bak/
121+
122+
# Spyder project settings
123+
.spyderproject
124+
.spyproject
125+
126+
# Rope project settings
127+
.ropeproject
128+
129+
# mkdocs documentation
130+
/site
131+
132+
# mypy
133+
.mypy_cache/
134+
.dmypy.json
135+
dmypy.json
136+
137+
# Pyre type checker
138+
.pyre/
139+
140+
# pytype static type analyzer
141+
.pytype/
142+
143+
# Cython debug symbols
144+
cython_debug/

.env.ci

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ENV=ci
2+
APP_TITLE="Template Project"
3+
APP_NAME=fastapidefault
4+
5+
POSTGRES_HOST=localhost
6+
POSTGRES_PORT=5432
7+
POSTGRES_USER=test
8+
POSTGRES_PASSWORD=test
9+
POSTGRES_DB=test
10+
11+
SENTRY_DSN=
12+
PROMETHEUS_METRICS_KEY=key

.env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ENV=local
2+
APP_TITLE="Template Project"
3+
APP_NAME=fastapidefault
4+
DEBUG=true
5+
6+
POSTGRES_HOST=localhost
7+
POSTGRES_PORT=33432
8+
POSTGRES_USER=postgres
9+
POSTGRES_PASSWORD=postgres
10+
POSTGRES_DB=exampledb
11+
12+
SENTRY_DSN=
13+
PROMETHEUS_METRICS_KEY=

.env.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
APP_TITLE="Template Project"
2+
APP_NAME=fastapidefault
3+
ENV=test
4+
5+
POSTGRES_HOST=localhost
6+
POSTGRES_PORT=25439
7+
POSTGRES_USER=postgres
8+
POSTGRES_PASSWORD=postgres
9+
POSTGRES_DB=exampledb
10+
11+
SENTRY_DSN=
12+
PROMETHEUS_METRICS_KEY=key
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/cd.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy FastAPI Application to Server for Production
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repository
13+
uses: actions/checkout@v3
14+
15+
- name: Deploy to Server
16+
uses: appleboy/ssh-action@v1.0.3
17+
with:
18+
host: ${{ secrets.SSH_HOST }}
19+
username: ${{ secrets.SSH_USER }}
20+
port: ${{ secrets.SSH_PORT }}
21+
password: ${{ secrets.SSH_PASSWORD }}
22+
script: |
23+
set -e
24+
cd ${{ secrets.DEPLOY_PATH }}
25+
echo "Pulling latest changes from main branch..."
26+
git fetch --all
27+
git reset --hard origin/main
28+
echo "Building and restarting Docker containers..."
29+
docker compose pull
30+
docker compose up -d --build
31+
echo "Cleaning up unused Docker images..."
32+
docker image prune -af
33+
echo "Deployment completed successfully!"

0 commit comments

Comments
 (0)