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 😝
|
# easter eggs 😝
|
||||||
RUN echo "PS1='🕵️:\[\033[1;36m\]\h \[\033[1;34m\]\W\[\033[0;35m\]\[\033[1;36m\]$ \[\033[0m\]'" >> ~/.bashrc
|
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",
|
"password": "password",
|
||||||
}))
|
}))
|
||||||
|
|
||||||
docker_build('mev-inspect', '.',
|
docker_build('mev-inspect-py', '.',
|
||||||
live_update=[
|
live_update=[
|
||||||
sync('.', '/app'),
|
sync('.', '/app'),
|
||||||
run('cd /app && poetry install',
|
run('cd /app && poetry install',
|
||||||
|
@ -16,9 +16,8 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: mev-inspect
|
- name: mev-inspect
|
||||||
image: mev-inspect:latest
|
image: mev-inspect-py
|
||||||
command: [ "/bin/bash", "-c", "--" ]
|
command: [ "python", "run.py"]
|
||||||
args: [ "while true; do sleep 30; done;" ]
|
|
||||||
env:
|
env:
|
||||||
- name: POSTGRES_USER
|
- name: POSTGRES_USER
|
||||||
valueFrom:
|
valueFrom:
|
||||||
@ -30,6 +29,8 @@ spec:
|
|||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: mev-inspect-db-credentials
|
name: mev-inspect-db-credentials
|
||||||
key: password
|
key: password
|
||||||
|
- name: POSTGRES_HOST
|
||||||
|
value: postgresql
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
exec:
|
exec:
|
||||||
command:
|
command:
|
||||||
|
@ -7,9 +7,9 @@ from sqlalchemy.orm import sessionmaker
|
|||||||
def get_sqlalchemy_database_uri():
|
def get_sqlalchemy_database_uri():
|
||||||
username = os.getenv("POSTGRES_USER")
|
username = os.getenv("POSTGRES_USER")
|
||||||
password = os.getenv("POSTGRES_PASSWORD")
|
password = os.getenv("POSTGRES_PASSWORD")
|
||||||
server = "postgresql"
|
host = os.getenv("POSTGRES_HOST")
|
||||||
db_name = "mev_inspect"
|
db_name = "mev_inspect"
|
||||||
return f"postgresql://{username}:{password}@{server}/{db_name}"
|
return f"postgresql://{username}:{password}@{host}/{db_name}"
|
||||||
|
|
||||||
|
|
||||||
def get_engine():
|
def get_engine():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user