-
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.
- Loading branch information
Showing
3 changed files
with
64 additions
and
0 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,4 @@ | ||
fly.toml | ||
.git/ | ||
*.sqlite3 | ||
.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,27 @@ | ||
ARG PYTHON_VERSION=3.12-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 | ||
|
||
RUN pip install pipenv | ||
COPY Pipfile Pipfile.lock /code/ | ||
RUN pipenv install --deploy --system | ||
COPY . /code | ||
|
||
RUN python manage.py collectstatic --noinput | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["gunicorn", "--bind", ":8000", "--workers", "2", "ashar_app.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,33 @@ | ||
# fly.toml app configuration file generated for ashar-backend on 2024-03-09T20:23:08+01:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = 'ashar-backend' | ||
primary_region = 'waw' | ||
console_command = '/code/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]] | ||
memory = '1gb' | ||
cpu_kind = 'shared' | ||
cpus = 1 | ||
|
||
[[statics]] | ||
guest_path = '/code/static' | ||
url_prefix = '/static/' |