Skip to content

Commit cb5ef6e

Browse files
committed
Update script to deploy app with postgres
1 parent 0930bcf commit cb5ef6e

2 files changed

Lines changed: 50 additions & 1 deletion

File tree

scripts/configs/fly-postgres.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# fly.toml app configuration file generated for web-framework-2025-lively-glitter-9000 on 2025-02-25T21:58:41-05:00
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'web-framework-2025-lively-glitter-9000'
7+
primary_region = 'iad'
8+
console_command = '/code/manage.py shell'
9+
10+
[build]
11+
12+
[deploy]
13+
release_command = 'python manage.py migrate --noinput'
14+
15+
[env]
16+
PORT = '8000'
17+
18+
[http_service]
19+
internal_port = 8000
20+
force_https = true
21+
auto_stop_machines = 'stop'
22+
auto_start_machines = true
23+
min_machines_running = 0
24+
processes = ['app']
25+
26+
[[vm]]
27+
memory = '512mb'
28+
cpu_kind = 'shared'
29+
cpus = 1
30+
31+
[[statics]]
32+
guest_path = '/code/static'
33+
url_prefix = '/static/'

scripts/deploy-fly.io-postgres.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
#!/usr/bin/env bash
22

3+
# Specify the target fly.toml configuration file
4+
function specify_target_fly_toml() {
5+
# Move currently active fly.toml configuration file to local tmp directory
6+
if [ -f fly.toml ]; then
7+
mkdir -p .tmp
8+
mv fly.toml .tmp/fly.toml
9+
fi
10+
11+
# Copy target fly.toml configuration file to project root directory
12+
cp -p ./scripts/configs/fly-postgres.toml fly.toml
13+
}
14+
specify_target_fly_toml
15+
316
# Launch app
4-
yes n | fly launch --vm-memory 512 --now --copy-config
17+
yes n | fly launch --now --copy-config
18+
19+
# Restore existing fly.toml
20+
mv .tmp/fly.toml fly.toml

0 commit comments

Comments
 (0)