Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

Commit 508faea

Browse files
committed
fix release command
1 parent 2a44876 commit 508faea

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ COPY . /code/
3838

3939
RUN python manage.py collectstatic --noinput
4040

41-
RUN python manage.py createcachetable
42-
4341
EXPOSE 8000
4442

4543
# replace demo.wsgi with <project_name>.wsgi

fly.io.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ fly launch --dockerfile Dockerfile
4545

4646
Now say YES when asked if you want to create a Postgres DB.
4747

48-
> We recommend using the database_url(pip install dj-database-url) to parse the DATABASE_URL from os.environ['DATABASE_URL']
48+
> We recommend using the database_url (`pip install dj-database-url`) to parse the DATABASE_URL from os.environ['DATABASE_URL']
4949
>
50-
> For detailed documentation, see https://fly.dev/docs/django/
50+
> For detailed documentation, see <https://fly.dev/docs/django/>
5151
5252
Why not - changed configuration style to use `dj-database-uri`.
5353

@@ -155,6 +155,14 @@ Add to `tly.toml`:
155155

156156
Then `flyctl deploy`.
157157

158+
## Connect to database
159+
160+
```bash
161+
fly proxy 15432:5432 -a optimap-db
162+
```
163+
164+
Connect to database locally at port `15432`, e.g., with pgAdmin.
165+
158166
## Future
159167

160168
- Database backups, see <https://www.joseferben.com/posts/django-on-flyio/>

fly.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ processes = []
99
dockerfile = "Dockerfile"
1010

1111
[deploy]
12-
release_command = "python manage.py migrate"
12+
release_command = "sh release_command.sh"
1313

1414
[env]
1515
OPTIMAP_ALLOWED_HOST = "optimap.science,optimap.fly.dev"

release_command.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh -e
2+
python manage.py migrate
3+
python manage.py createcachetable

0 commit comments

Comments
 (0)