Andrchest commited on
Commit
18299c6
·
1 Parent(s): e14ad37

final try 12

Browse files
Files changed (4) hide show
  1. Dockerfile +7 -3
  2. app/initializer.py +1 -2
  3. app/main.py +2 -1
  4. app/settings.py +1 -1
Dockerfile CHANGED
@@ -1,9 +1,14 @@
1
  # syntax=docker/dockerfile:1
2
  FROM python:3.12
3
 
 
 
4
  # avoid root, but Spaces run as root so this is informational
5
  RUN addgroup --system app && adduser --system --ingroup app app
6
 
 
 
 
7
  WORKDIR /app
8
 
9
  # system deps for Qdrant and psycopg2, cleanup
@@ -19,8 +24,6 @@ RUN apt-get update \
19
  && apt-get clean \
20
  && rm -rf /var/lib/apt/lists/*
21
 
22
- # … rest of file unchanged …
23
-
24
 
25
  # copy and install Python reqs
26
  COPY app/requirements.txt /app/requirements.txt
@@ -30,6 +33,7 @@ RUN pip install --no-cache-dir -r /app/requirements.txt
30
  # initializing some directiores
31
  CMD ["python", "-m", "app.initializer"]
32
 
 
33
 
34
  # download Qdrant binary
35
  RUN wget https://github.com/qdrant/qdrant/releases/download/v1.11.5/qdrant-x86_64-unknown-linux-gnu.tar.gz \
@@ -38,7 +42,7 @@ RUN wget https://github.com/qdrant/qdrant/releases/download/v1.11.5/qdrant-x86_6
38
  && rm qdrant-x86_64-unknown-linux-gnu.tar.gz
39
 
40
  # copy your application code
41
- COPY app /app/app
42
 
43
  # bring in start script
44
  COPY start.sh /app/start.sh
 
1
  # syntax=docker/dockerfile:1
2
  FROM python:3.12
3
 
4
+ LABEL authors="user"
5
+
6
  # avoid root, but Spaces run as root so this is informational
7
  RUN addgroup --system app && adduser --system --ingroup app app
8
 
9
+ ENV PYTHONDONTWRITEBYTECODE 1
10
+ ENV PYTHONUNBUFFERED 1
11
+
12
  WORKDIR /app
13
 
14
  # system deps for Qdrant and psycopg2, cleanup
 
24
  && apt-get clean \
25
  && rm -rf /var/lib/apt/lists/*
26
 
 
 
27
 
28
  # copy and install Python reqs
29
  COPY app/requirements.txt /app/requirements.txt
 
33
  # initializing some directiores
34
  CMD ["python", "-m", "app.initializer"]
35
 
36
+ COPY ./app /app
37
 
38
  # download Qdrant binary
39
  RUN wget https://github.com/qdrant/qdrant/releases/download/v1.11.5/qdrant-x86_64-unknown-linux-gnu.tar.gz \
 
42
  && rm qdrant-x86_64-unknown-linux-gnu.tar.gz
43
 
44
  # copy your application code
45
+ #COPY app /app/app
46
 
47
  # bring in start script
48
  COPY start.sh /app/start.sh
app/initializer.py CHANGED
@@ -1,6 +1,5 @@
1
  import os
2
 
3
- from app.backend.models.db_service import automigrate
4
  from app.settings import base_path
5
 
6
 
@@ -32,5 +31,5 @@ def initialize_system() -> bool:
32
 
33
 
34
  if __name__ == '__main__':
 
35
  initialize_system()
36
- automigrate()
 
1
  import os
2
 
 
3
  from app.settings import base_path
4
 
5
 
 
31
 
32
 
33
  if __name__ == '__main__':
34
+ print(1111111111111111111111111111111111111111111111)
35
  initialize_system()
 
app/main.py CHANGED
@@ -1,5 +1,6 @@
1
  import uvicorn
2
 
 
3
  from app.settings import api_config
4
 
5
 
@@ -7,10 +8,10 @@ def main():
7
  # if not initialize_system():
8
  # return
9
  # automigrate() # Note: it will drop all existing dbs and create a new ones
 
10
  uvicorn.run(**api_config)
11
 
12
 
13
  if __name__ == '__main__':
14
-
15
  # ATTENTION: run from base dir ---> python -m app.main
16
  main()
 
1
  import uvicorn
2
 
3
+ from app.backend.models.db_service import automigrate
4
  from app.settings import api_config
5
 
6
 
 
8
  # if not initialize_system():
9
  # return
10
  # automigrate() # Note: it will drop all existing dbs and create a new ones
11
+ automigrate()
12
  uvicorn.run(**api_config)
13
 
14
 
15
  if __name__ == '__main__':
 
16
  # ATTENTION: run from base dir ---> python -m app.main
17
  main()
app/settings.py CHANGED
@@ -85,7 +85,7 @@ password = "lol"
85
  dbname = "exp"
86
 
87
  postgres_client_config = {
88
- "url": os.environ['DATABASE_URL'],
89
  "echo": False,
90
  }
91
 
 
85
  dbname = "exp"
86
 
87
  postgres_client_config = {
88
+ # "url": os.environ['DATABASE_URL'],
89
  "echo": False,
90
  }
91