Skip to content

Commit

Permalink
Add docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel7004 committed Nov 13, 2024
1 parent 1a7d05c commit fdbe546
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
16 changes: 16 additions & 0 deletions backend/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.11-slim

RUN apt-get update && apt-get install -y \
gcc \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt

COPY . /app

EXPOSE 8000

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
41 changes: 41 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: '3.9'

services:
frontend:
build:
context: ./frontend
dockerfile: Containerfile
ports:
- '8080:8000' # Map host port 3000 to container port 8000 (Deno app)
depends_on:
- backend
networks:
- app-network

backend:
build:
context: ./backend
dockerfile: Containerfile
ports:
- '8000:8000' # Map host port 8000 to container port 8000 (FastAPI app)
depends_on:
- neo4j
environment:
- NEO4J_URI=bolt://neo4j:7687
- NEO4J_USER=neo4j
- NEO4J_PASSWORD=neo4jpassword
networks:
- app-network

neo4j:
image: neo4j:latest
ports:
- '7474:7474' # HTTP access
- '7687:7687' # Bolt access
environment:
- NEO4J_AUTH=neo4j/neo4jpassword
networks:
- app-network

networks:
app-network:
9 changes: 9 additions & 0 deletions frontend/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM denoland/deno:alpine

WORKDIR /app

COPY . /app

EXPOSE 8000

CMD ["run", "--allow-net", "--allow-read", "main.ts"]

0 comments on commit fdbe546

Please sign in to comment.