1
0
mirror of https://github.com/ijaric/voice_assistant.git synced 2025-05-24 14:33:26 +00:00

fix: docker files & minor fixes

This commit is contained in:
Artem Litvinov 2023-09-23 19:21:32 +01:00
parent 5a02281651
commit 8dead13cc2
6 changed files with 14 additions and 10 deletions

View File

@ -1,5 +1,11 @@
FROM python:3.11 FROM python:3.11
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
&& apt-get install -y net-tools netcat-traditional curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir --parents /opt/app RUN mkdir --parents /opt/app
COPY pyproject.toml /opt/app/pyproject.toml COPY pyproject.toml /opt/app/pyproject.toml
COPY poetry.lock /opt/app/poetry.lock COPY poetry.lock /opt/app/poetry.lock

View File

@ -1,7 +1,7 @@
version: "3" version: "3"
services: services:
db: postgres:
image: postgres:15.2 image: postgres:15.2
restart: always restart: always
environment: environment:
@ -29,7 +29,7 @@ services:
ports: ports:
- "${API_PORT}:${API_PORT}" - "${API_PORT}:${API_PORT}"
depends_on: depends_on:
- db - postgres
networks: networks:
- backend_network - backend_network
- api_network - api_network

View File

@ -1,7 +1,7 @@
version: "3" version: "3"
services: services:
db: postgres:
image: postgres:15.2 image: postgres:15.2
restart: always restart: always
environment: environment:
@ -29,7 +29,7 @@ services:
expose: expose:
- "${API_PORT}" - "${API_PORT}"
depends_on: depends_on:
- db - postgres
networks: networks:
- backend_network - backend_network
- api_network - api_network

View File

@ -1,7 +1,5 @@
#!/bin/bash #!/bin/bash
while ! (echo > /dev/tcp/db/5432) >/dev/null 2>&1; do while ! nc -z postgres 5432; do sleep 1; done;
sleep 1
done
exec .venv/bin/python -m bin exec .venv/bin/python -m bin

View File

@ -6,7 +6,7 @@ from .project import *
__all__ = [ __all__ = [
"ApiSettings", "ApiSettings",
"LoggingSettings", "LoggingSettings",
"get_logging_config",
"PostgresSettings", "PostgresSettings",
"ProjectSettings", "ProjectSettings",
"get_logging_config",
] ]

View File

@ -4,7 +4,7 @@ server {
server_name _; server_name _;
location /api { location /api {
proxy_pass http://api:${SERVER_PORT}/api; proxy_pass http://api:${API_PORT}/api;
proxy_set_header X-Request-Id $request_id; proxy_set_header X-Request-Id $request_id;
} }