gabcares commited on
Commit
92270c9
·
verified ·
1 Parent(s): 6e3dc0c

Upload 5 files

Browse files

Team Curium API App

Files changed (5) hide show
  1. .dockerignore +21 -0
  2. .gitignore +162 -0
  3. Dockerfile +23 -0
  4. docker-compose.yml +36 -0
  5. requirements_docker.txt +85 -0
.dockerignore ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Exclude files not needed for Docker build
2
+ *__pycache__/
3
+ *.pyc
4
+ *.pyo
5
+
6
+ # Exclude log files but keep the logs directory
7
+ logs/*
8
+ !logs/.gitkeep
9
+
10
+ # Exclude notebook checkpoints
11
+ *.ipynb_checkpoints/
12
+
13
+ # Environments
14
+ .env
15
+ *.env
16
+ .venv
17
+ env/
18
+ venv/
19
+ ENV/
20
+ env.bak/
21
+ venv.bak/
.gitignore ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110
+ .pdm.toml
111
+ .pdm-python
112
+ .pdm-build/
113
+
114
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115
+ __pypackages__/
116
+
117
+ # Celery stuff
118
+ celerybeat-schedule
119
+ celerybeat.pid
120
+
121
+ # SageMath parsed files
122
+ *.sage.py
123
+
124
+ # Environments
125
+ .env
126
+ .venv
127
+ env/
128
+ venv/
129
+ ENV/
130
+ env.bak/
131
+ venv.bak/
132
+
133
+ # Spyder project settings
134
+ .spyderproject
135
+ .spyproject
136
+
137
+ # Rope project settings
138
+ .ropeproject
139
+
140
+ # mkdocs documentation
141
+ /site
142
+
143
+ # mypy
144
+ .mypy_cache/
145
+ .dmypy.json
146
+ dmypy.json
147
+
148
+ # Pyre type checker
149
+ .pyre/
150
+
151
+ # pytype static type analyzer
152
+ .pytype/
153
+
154
+ # Cython debug symbols
155
+ cython_debug/
156
+
157
+ # PyCharm
158
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
161
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
162
+ #.idea/
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11.9-slim
2
+
3
+ # Copy requirements file
4
+ COPY requirements_docker.txt .
5
+
6
+ # Update pip
7
+ RUN pip install --no-cache-dir --upgrade pip
8
+
9
+ # Install dependecies
10
+ RUN pip install --no-cache-dir -r requirements_docker.txt
11
+
12
+ # Copy API
13
+ RUN mkdir /src/
14
+ COPY ./src /src
15
+
16
+ # Set workdir
17
+ WORKDIR /
18
+
19
+ # Expose app port
20
+ EXPOSE 9000
21
+
22
+ # Start application
23
+ CMD ["uvicorn", "src.api.api:app", "--host", "0.0.0.0", "--port", "9000", "--reload"]
docker-compose.yml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ cache:
3
+ image: redis:7.2.3-alpine
4
+ restart: always
5
+ ports:
6
+ - "6379:6379"
7
+ volumes:
8
+ - redis_data:/data
9
+ networks:
10
+ app-tier:
11
+
12
+ api:
13
+ build:
14
+ context: .
15
+ dockerfile: Dockerfile
16
+ command: uvicorn src.api.api:app --host 0.0.0.0 --port 9000 --reload
17
+ volumes:
18
+ - ./src:/src
19
+ ports:
20
+ - "9000:9000"
21
+ env_file:
22
+ - path: ./src/api/.env
23
+ required: false
24
+ - path: ./.env
25
+ required: false
26
+ depends_on:
27
+ - cache
28
+ networks:
29
+ app-tier:
30
+
31
+ networks:
32
+ app-tier:
33
+ driver: bridge
34
+
35
+ volumes:
36
+ redis_data: {}
requirements_docker.txt ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiohttp==3.9.5
2
+ aiosignal==1.3.1
3
+ annotated-types==0.7.0
4
+ anyio==4.4.0
5
+ asttokens==2.4.1
6
+ attrs==23.2.0
7
+ certifi==2024.7.4
8
+ click==8.1.7
9
+ colorama==0.4.6
10
+ comm==0.2.2
11
+ contourpy==1.2.1
12
+ cycler==0.12.1
13
+ debugpy==1.6.7
14
+ decorator==5.1.1
15
+ dnspython==2.6.1
16
+ email_validator==2.2.0
17
+ exceptiongroup==1.2.0
18
+ executing==2.0.1
19
+ fastapi==0.111.0
20
+ fastapi-cache2==0.2.1
21
+ fastapi-cli==0.0.4
22
+ fonttools==4.53.1
23
+ frozenlist==1.4.1
24
+ h11==0.14.0
25
+ httpcore==1.0.5
26
+ httptools==0.6.1
27
+ httpx==0.27.0
28
+ idna==3.7
29
+ imbalanced-learn==0.12.3
30
+ imblearn==0.0
31
+ importlib_metadata==8.0.0
32
+ jedi==0.19.1
33
+ Jinja2==3.1.4
34
+ joblib==1.4.2
35
+ mdurl==0.1.2
36
+ multidict==6.0.5
37
+ nest_asyncio==1.6.0
38
+ numpy==2.0.0
39
+ orjson==3.10.6
40
+ packaging==24.1
41
+ pandas==2.2.2
42
+ parso==0.8.4
43
+ pendulum==3.0.0
44
+ pickleshare==0.7.5
45
+ pillow==10.4.0
46
+ pip==24.0
47
+ platformdirs==4.2.2
48
+ prompt_toolkit==3.0.47
49
+ pure-eval==0.2.2
50
+ pydantic==2.8.2
51
+ pydantic_core==2.20.1
52
+ Pygments==2.18.0
53
+ pyparsing==3.1.2
54
+ python-dateutil==2.9.0
55
+ python-dotenv==1.0.1
56
+ python-multipart==0.0.9
57
+ pytz==2024.1
58
+ PyYAML==6.0.1
59
+ pyzmq==25.1.2
60
+ redis==5.0.7
61
+ rich==13.7.1
62
+ scikit-learn==1.5.1
63
+ scipy==1.14.0
64
+ shellingham==1.5.4
65
+ six==1.16.0
66
+ sniffio==1.3.1
67
+ stack-data==0.6.2
68
+ starlette==0.37.2
69
+ tenacity==8.5.0
70
+ threadpoolctl==3.5.0
71
+ time-machine==2.14.2
72
+ tornado==6.4.1
73
+ traitlets==5.14.3
74
+ typer==0.12.3
75
+ typing_extensions==4.12.2
76
+ tzdata==2024.1
77
+ ujson==5.10.0
78
+ uvicorn==0.30.1
79
+ watchfiles==0.22.0
80
+ wcwidth==0.2.13
81
+ websockets==12.0
82
+ wheel==0.43.0
83
+ xgboost==2.1.0
84
+ yarl==1.9.4
85
+ zipp==3.19.2