Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rudimentary Docker support #7

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
5 changes: 3 additions & 2 deletions requirements.txt → app/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ prophet
nbformat
nbconvert
nbclient
schedule
schedule==1.2.1
pocketbase
quantstats
ipython
Expand All @@ -36,4 +36,5 @@ faker
finnhub-python
intrinio_sdk
openai
slowapi
slowapi
orjson
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions fastify/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:20-alpine

WORKDIR /stocknear-backend

COPY . .
RUN npm install

CMD ["npm", "run", "start"]