Commit 720ad289 authored by banashree.p's avatar banashree.p

dockercompose

parent a762cc02
# Default ignored files
/shelf/
/workspace.xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="main.device" />
<option value="main.Dr_Bana" />
<option value="str.__setitem__" />
<option value="fastapi.task2" />
</list>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (dockercompose)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/dockercompose.iml" filepath="$PROJECT_DIR$/.idea/dockercompose.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>
\ No newline at end of file
FROM python:3-alpine
COPY requirements.txt .
RUN pip install -qr requirements.txt
COPY main.py .
CMD ["python3", "./main.py"]
\ No newline at end of file
version: "3.7"
services:
web:
build: .
ports:
- "8010:5000"
image: "compose"
version: '3'
services:
beersnob_database:
container_name: beersnob_database
hostname: beersnob_database
image: postgres
volumes:
- ./volume:/var/lib/postgresql
environment:
- POSTGRES_DB=beersnobdb, beersnobdb_dev
- POSTGRES_USER=mhuls
- POSTGRES_PASSWORD=aStrongPassword
ports:
- 54321:5432
restart: unless-stopped
beersnob_api:
container_name: beersnob_api
hostname: beersnob_api
build:
context: ./beersnob_api
dockerfile: Dockerfile
ports:
- 54322:5000
volumes:
- ./beersnob_api/src/:/usr/src/app/
- /usr/src/app/node_modules
restart: unless-stopped
environment:
NODE_ENV: ${BEERSNOB_ENVIRONMENT}
depends_on:
- beersnob_database
\ No newline at end of file
from fastapi import FastAPI
import uvicorn
#import requirements.txt
app = FastAPI()
@app.get("/getdata")
def get_data1():
return {"my docker image"}
if __name__ == "__main__":
uvicorn.run ("main:app", host="0.0.0.0", port=8010)
\ No newline at end of file
flask==2.0.3
redis==3.5.3
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment