Skip to content

Commit

Permalink
Get fly working. Try downgrading pandas
Browse files Browse the repository at this point in the history
  • Loading branch information
aled1027 committed Jun 12, 2023
1 parent 6cccb01 commit 7e4d346
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 61 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fly.toml
.git/
*.sqlite3
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# pull official base image
FROM python:3.10

# set work directory
WORKDIR /usr/src/app

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

COPY . .

# install dependencies
RUN pip install poetry
RUN poetry config virtualenvs.create false \
&& poetry install

EXPOSE 8000

CMD ["poetry", "run", "python", "-m", "uvicorn", "config.asgi:application", "--host", "0.0.0.0", "--port", "8000"]
18 changes: 8 additions & 10 deletions config/asgi.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
"""
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")

# Initialize Django ASGI application early to ensure the AppRegistry
# is populated before importing code that may import ORM models.
django_asgi_app = get_asgi_application()


application = ProtocolTypeRouter(
{
"http": django_asgi_app,
}
)
application = get_asgi_application()
25 changes: 25 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# fly.toml app configuration file generated for barter on 2023-06-12T12:01:15-07:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "barter"
primary_region = "sea"
# console_command = "/code/manage.py shell"

[deploy]
release_command = "poetry run python manage.py migrate"

[env]
PORT = "8000"

[http_service]
internal_port = 8000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0

# [[statics]]
# guest_path = "/code/static"
# url_prefix = "/static/"
101 changes: 51 additions & 50 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ whitenoise = "^6.3.0"
pre-commit = "^3.1.1"
ruff = "^0.0.254"
django-import-export = "^3.1.0"
pandas = "^2.0.0"
pandas = "1.5.3"
celery = "^5.2.7"
django-model-utils = "^4.3.1"
dateparser = "^1.1.8"
Expand All @@ -38,6 +38,7 @@ isort = "^5.12.0"
django-adminactions = "^2.1.0"
django-admin-charts = "^1.3.0"
django-sql-explorer = {extras = ["charts"], version = "^3.2"}
channels = "^4.0.0"

[tool.ruff]
ignore = ["E501", "E402"]
Expand Down

0 comments on commit 7e4d346

Please sign in to comment.