Switch CMD to python loop. Make host an environment variable
This commit is contained in:
parent
23d03b990d
commit
b2d2c7dbeb
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
||||
tests
|
||||
cache
|
@ -18,4 +18,4 @@ COPY . /app
|
||||
# easter eggs 😝
|
||||
RUN echo "PS1='🕵️:\[\033[1;36m\]\h \[\033[1;34m\]\W\[\033[0;35m\]\[\033[1;36m\]$ \[\033[0m\]'" >> ~/.bashrc
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
CMD [ "python", "run.py"]
|
||||
|
2
Tiltfile
2
Tiltfile
@ -11,7 +11,7 @@ k8s_yaml(secret_from_dict("mev-inspect-db-credentials", inputs = {
|
||||
"password": "password",
|
||||
}))
|
||||
|
||||
docker_build('mev-inspect', '.',
|
||||
docker_build('mev-inspect-py', '.',
|
||||
live_update=[
|
||||
sync('.', '/app'),
|
||||
run('cd /app && poetry install',
|
||||
|
@ -16,9 +16,8 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: mev-inspect
|
||||
image: mev-inspect:latest
|
||||
command: [ "/bin/bash", "-c", "--" ]
|
||||
args: [ "while true; do sleep 30; done;" ]
|
||||
image: mev-inspect-py
|
||||
command: [ "python", "run.py"]
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
@ -30,6 +29,8 @@ spec:
|
||||
secretKeyRef:
|
||||
name: mev-inspect-db-credentials
|
||||
key: password
|
||||
- name: POSTGRES_HOST
|
||||
value: postgresql
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
|
@ -7,9 +7,9 @@ from sqlalchemy.orm import sessionmaker
|
||||
def get_sqlalchemy_database_uri():
|
||||
username = os.getenv("POSTGRES_USER")
|
||||
password = os.getenv("POSTGRES_PASSWORD")
|
||||
server = "postgresql"
|
||||
host = os.getenv("POSTGRES_HOST")
|
||||
db_name = "mev_inspect"
|
||||
return f"postgresql://{username}:{password}@{server}/{db_name}"
|
||||
return f"postgresql://{username}:{password}@{host}/{db_name}"
|
||||
|
||||
|
||||
def get_engine():
|
||||
|
Loading…
x
Reference in New Issue
Block a user