diff --git a/app/Dockerfile b/app/Dockerfile new file mode 100644 index 0000000..0a9976f --- /dev/null +++ b/app/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.10 + +WORKDIR /stocknear-backend + +COPY requirements.txt . +RUN pip install -r requirements.txt +COPY . . + + +CMD ["uvicorn", "main:app", "--reload"] \ No newline at end of file diff --git a/requirements.txt b/app/requirements.txt similarity index 92% rename from requirements.txt rename to app/requirements.txt index 8202d9a..72ba3c0 100755 --- a/requirements.txt +++ b/app/requirements.txt @@ -25,7 +25,7 @@ prophet nbformat nbconvert nbclient -schedule +schedule==1.2.1 pocketbase quantstats ipython @@ -36,4 +36,5 @@ faker finnhub-python intrinio_sdk openai -slowapi \ No newline at end of file +slowapi +orjson \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8afd7b0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,33 @@ +services: + # Still need to import .db files and json folder (see Discord) manually. + app-backend: + image: stocknear/app-backend + build: ./app + ports: + - 8000:8000 + depends_on: + - redis + fastify-backend: + image: stocknear/fastify-backend + build: ./fastify + ports: + - 2000:2000 + environment: + - FMP_API_KEY="" + - MIXPANEL_API_KEY="" # If this is not set to a valid value the app will crash. You can comment out l. 25 and l. 58 in fastify/app.js to get it to work. + - TWITCH_API_KEY="" + - TWITCH_SECRET_KEY="" + depends_on: + - pocketbase + redis: + image: redis:6.2-alpine + ports: + - '6379:6379' + # UNOFFICIAL IMAGE! To do it correctly either set up local instance or make own Dockerfile until official Docker Image is out. + # Still need to import schema.json manually. Is there an automated way? + pocketbase: + image: ghcr.io/muchobien/pocketbase:latest + ports: + - "8090:8090" + volumes: + - ./pocketbase_data:/pb_data \ No newline at end of file diff --git a/fastify/Dockerfile b/fastify/Dockerfile new file mode 100644 index 0000000..188f952 --- /dev/null +++ b/fastify/Dockerfile @@ -0,0 +1,8 @@ +FROM node:20-alpine + +WORKDIR /stocknear-backend + +COPY . . +RUN npm install + +CMD ["npm", "run", "start"] \ No newline at end of file