Skip to content

Commit cebfab0

Browse files
committed
migrate from dockerized postgresql to system-wide postgresql
1 parent dd6743d commit cebfab0

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

config/deploy.yml

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ env:
3838
- RAILS_MASTER_KEY
3939
- POSTGRES_PASSWORD
4040
clear:
41-
# The hostname is constructed as [service_name]-[accessory_name].
42-
DB_HOST: telegram_spam_sniper_bot-postgres
43-
DB_PORT: 5432
41+
DB_HOST: 172.17.0.1 # Docker's default bridge network gateway (host machine)
42+
DB_PORT: 5433
4443
POSTGRES_USER: rails_user
4544
POSTGRES_DB: telegram_spam_sniper_bot_production
4645
# Run the Solid Queue Supervisor inside the web server's Puma process to do jobs.
@@ -99,38 +98,19 @@ builder:
9998

10099
# Use accessory services (secrets come from .kamal/secrets).
101100
accessories:
102-
postgres:
103-
image: postgres:15
104-
host: 192.168.1.188
105-
port: "5432:5432"
106-
env:
107-
clear:
108-
POSTGRES_USER: rails_user
109-
POSTGRES_DB: telegram_spam_sniper_bot_production
110-
secret:
111-
- RAILS_MASTER_KEY
112-
- POSTGRES_PASSWORD
113-
directories:
114-
- data:/var/lib/postgresql/data
115-
files:
116-
- db/production_setup.sql:/docker-entrypoint-initdb.d/setup.sql
117-
volumes:
118-
- "/tmp/migration_data:/rails/db/data"
119-
120101
runner:
121102
host: 192.168.1.188
122103
image: samrayleung/telegram_spam_sniper_bot
123104
cmd: sleep infinity # Keeps the container running but idle
124105
env:
125106
clear:
126-
DB_HOST: telegram_spam_sniper_bot-postgres
107+
DB_HOST: 172.17.0.1
108+
DB_PORT: 5433
127109
POSTGRES_USER: rails_user
128110
POSTGRES_DB: telegram_spam_sniper_bot_production
129111
secret:
130112
- RAILS_MASTER_KEY
131113
- POSTGRES_PASSWORD
132-
directories:
133-
- data:/var/lib/postgresql/data
134114
volumes:
135115
- "/tmp/migration_data:/rails/db/data"
136116

0 commit comments

Comments
 (0)