Docker-compose with the couchdb backend
This commit is contained in:
		
							parent
							
								
									de85790ffa
								
							
						
					
					
						commit
						1424fb2f43
					
				
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1,3 +1,5 @@ | |||||||
| /target | /target | ||||||
| venv | venv | ||||||
| __pycache__ | __pycache__ | ||||||
|  | /.env | ||||||
|  | /data/ | ||||||
|  | |||||||
							
								
								
									
										19
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								Dockerfile
									
									
									
									
									
								
							| @ -1,11 +1,18 @@ | |||||||
| FROM python:3.11 | # Use an official Python runtime as a parent image | ||||||
|  | FROM python:3 | ||||||
| 
 | 
 | ||||||
| WORKDIR /code | # Set the working directory in the container | ||||||
|  | WORKDIR /app | ||||||
| 
 | 
 | ||||||
| COPY ./requirements.txt /code/requirements.txt | # Install any needed packages specified in requirements.txt | ||||||
|  | COPY requirements.txt /app/ | ||||||
|  | RUN pip install --no-cache-dir -r requirements.txt | ||||||
| 
 | 
 | ||||||
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | # Copy the current directory contents into the container at /app | ||||||
|  | COPY . /app/ | ||||||
| 
 | 
 | ||||||
| COPY ./app /code/app | # Make port 8000 available to the world outside this container | ||||||
|  | EXPOSE 8000 | ||||||
| 
 | 
 | ||||||
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"] | # Run api.py when the container launches | ||||||
|  | CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8000"] | ||||||
|  | |||||||
							
								
								
									
										19
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,19 @@ | |||||||
|  | version: '3' | ||||||
|  | services: | ||||||
|  |   couchdb: | ||||||
|  |     image: couchdb:latest | ||||||
|  |     network_mode: host | ||||||
|  |     volumes: | ||||||
|  |       - ./data:/opt/couchdb/data:Z | ||||||
|  |     env_file: | ||||||
|  |       - .env | ||||||
|  | 
 | ||||||
|  |   fastapi_app: | ||||||
|  |     build: | ||||||
|  |       context: . | ||||||
|  |       dockerfile: Dockerfile | ||||||
|  |     network_mode: host | ||||||
|  |     depends_on: | ||||||
|  |       - couchdb | ||||||
|  |     env_file: | ||||||
|  |       - .env | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user