This commit is contained in:
2025-01-25 16:04:32 -03:00
parent 4d583cc238
commit 8add846bb9
3 changed files with 59 additions and 14 deletions

53
.idea/workspace.xml generated
View File

@@ -5,7 +5,8 @@
</component>
<component name="ChangeListManager">
<list default="true" id="8dec87a3-1d37-4987-9cda-facb38ae979f" name="Changes" comment="add FastAPI">
<change beforePath="$PROJECT_DIR$/.idea/export-sereia-guardia-tray.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/export-sereia-guardia-fastapi.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Dockerfile" afterDir="false" />
<change afterPath="$PROJECT_DIR$/docker-compose.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@@ -35,19 +36,19 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;Python.main (1).executor&quot;: &quot;Run&quot;,
&quot;Python.main.executor&quot;: &quot;Run&quot;,
&quot;Python.order_parser.executor&quot;: &quot;Run&quot;,
&quot;Python.products_sold_parser.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
&quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;C:/Users/chris/Documents/Projects/export-sereia-guardia-tray/db&quot;
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"Python.main (1).executor": "Run",
"Python.main.executor": "Run",
"Python.order_parser.executor": "Run",
"Python.products_sold_parser.executor": "Run",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
"ignore.virus.scanning.warn.message": "true",
"last_opened_file_path": "C:/Users/chris/Documents/Projects/export-sereia-guardia-fastapi"
}
}</component>
}]]></component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\chris\Documents\Projects\export-sereia-guardia-tray\db" />
@@ -205,7 +206,31 @@
<option name="project" value="LOCAL" />
<updated>1737831223736</updated>
</task>
<option name="localTasksCounter" value="2" />
<task id="LOCAL-00002" summary="add FastAPI">
<option name="closed" value="true" />
<created>1737831504461</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1737831504461</updated>
</task>
<task id="LOCAL-00003" summary="add FastAPI">
<option name="closed" value="true" />
<created>1737831513957</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1737831513957</updated>
</task>
<task id="LOCAL-00004" summary="add FastAPI">
<option name="closed" value="true" />
<created>1737831577005</created>
<option name="number" value="00004" />
<option name="presentableId" value="LOCAL-00004" />
<option name="project" value="LOCAL" />
<updated>1737831577005</updated>
</task>
<option name="localTasksCounter" value="5" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">

10
Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM python:3.12.8-slim-bullseye
WORKDIR /app
COPY . /app
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 8000
# Start the FastAPI server
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]

10
docker-compose.yml Normal file
View File

@@ -0,0 +1,10 @@
services:
fastapi-app:
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
volumes:
- .:/app # Mount the local directory to the container for development
command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload