-
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.
🚀 chore: Configuring deployment on Fly.io
- Loading branch information
1 parent
bea7eb3
commit 4555401
Showing
12 changed files
with
139 additions
and
84 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fly.toml | ||
.git/ | ||
*.sqlite3 |
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,26 @@ | ||
ARG PYTHON_VERSION=3.11-slim-bullseye | ||
|
||
FROM python:${PYTHON_VERSION} | ||
|
||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
# install psycopg2 dependencies. | ||
RUN apt-get update && apt-get install -y \ | ||
libpq-dev \ | ||
gcc \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN mkdir -p /code | ||
|
||
WORKDIR /code | ||
|
||
COPY requirements.txt /code/ | ||
RUN pip install --upgrade pip && pip install -r requirements.txt | ||
COPY . /code | ||
|
||
RUN python manage.py collectstatic --noinput | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["gunicorn", "--bind", ":8000", "--workers", "2", "timesheet.wsgi"] |
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,25 @@ | ||
version: '3.9' | ||
|
||
services: | ||
django-timesheet: | ||
container_name: django-timesheet | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "8000:8000" | ||
volumes: | ||
- ./timesheet:/timesheet | ||
env_file: | ||
- .env | ||
depends_on: | ||
- postgres-timesheet | ||
postgres-timesheet: | ||
container_name: postgres-timesheet | ||
image: postgres:16.1-alpine | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- postgres/data:/var/lib/postgresql/data/ | ||
env_file: | ||
- .env |
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,33 @@ | ||
# fly.toml app configuration file generated for timesheet-hick on 2024-02-04T19:25:37-04:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = 'timesheet-hick' | ||
primary_region = 'gru' | ||
console_command = 'manage.py shell' | ||
|
||
[build] | ||
|
||
[deploy] | ||
release_command = 'python manage.py migrate --noinput' | ||
|
||
[env] | ||
PORT = '8000' | ||
|
||
[http_service] | ||
internal_port = 8000 | ||
force_https = true | ||
auto_stop_machines = true | ||
auto_start_machines = true | ||
min_machines_running = 0 | ||
processes = ['app'] | ||
|
||
[[vm]] | ||
cpu_kind = 'shared' | ||
cpus = 1 | ||
memory_mb = 256 | ||
|
||
[[statics]] | ||
guest_path = '/code/static' | ||
url_prefix = '/static/' |
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 |
---|---|---|
@@ -1,41 +1,8 @@ | ||
asgiref==3.7.2 | ||
astroid==3.0.2 | ||
black==22.1.0 | ||
blue==0.9.1 | ||
chardet==5.2.0 | ||
click==8.1.7 | ||
colorama==0.4.6 | ||
convertdate==2.4.0 | ||
dill==0.3.7 | ||
Django==5.0 | ||
flake8==4.0.1 | ||
dj-database-url==2.1.0 | ||
gunicorn==21.2.0 | ||
isort==5.13.2 | ||
lunardate==0.2.2 | ||
mccabe==0.6.1 | ||
mypy-extensions==1.0.0 | ||
packaging==23.2 | ||
pathspec==0.12.1 | ||
Pillow==10.1.0 | ||
platformdirs==4.1.0 | ||
psutil==5.9.7 | ||
psycopg2-binary==2.9.9 | ||
pycodestyle==2.8.0 | ||
pyflakes==2.4.0 | ||
pylint==3.0.3 | ||
pylint-django==2.5.5 | ||
pylint-plugin-utils==0.8.2 | ||
pyluach==2.2.0 | ||
PyMeeus==0.5.12 | ||
python-dateutil==2.8.2 | ||
psycopg2==2.9.9 | ||
python-dotenv==1.0.0 | ||
reportlab==4.0.8 | ||
ruff==0.1.9 | ||
six==1.16.0 | ||
sqlparse==0.4.4 | ||
taskipy==1.12.2 | ||
timesheet @ file:///home/hick/git/timesheet | ||
tomli==2.0.1 | ||
tomlkit==0.12.3 | ||
whitenoise==6.6.0 | ||
workalendar==17.0.0 | ||
whitenoise==6.6.0 |
25 changes: 25 additions & 0 deletions
25
timesheet/app/migrations/0009_alter_pointrecord_register_date_and_more.py
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,25 @@ | ||
# Generated by Django 5.0 on 2024-02-05 00:33 | ||
|
||
import datetime | ||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('app', '0008_pointrecord_is_vacation'), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='pointrecord', | ||
name='register_date', | ||
field=models.DateField(default=datetime.date.today), | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='pointrecord', | ||
unique_together={('user', 'register_date')}, | ||
), | ||
] |
Empty file.
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import os | ||
|
||
from django.core.asgi import get_asgi_application | ||
from dotenv import load_dotenv | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'timesheet.settings') | ||
load_dotenv() | ||
|
||
application = get_asgi_application() |
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import os | ||
|
||
from django.core.wsgi import get_wsgi_application | ||
from dotenv import load_dotenv | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'timesheet.settings') | ||
load_dotenv() | ||
|
||
application = get_wsgi_application() |