Skip to content

Commit

Permalink
Add Dockerized Dev Environment
Browse files Browse the repository at this point in the history
Enables dev environment to be spun up with `docker compose -f
dev-env.yaml up` enables automatic rebuilding on changes and doesn't
require environment setup
  • Loading branch information
schreiaj committed Sep 6, 2024
1 parent 41107dd commit 0aaf972
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
13 changes: 13 additions & 0 deletions OCR/dev-dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.10-bullseye


RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y

RUN pip install poetry

COPY ./pyproject.toml /ocr/pyproject.toml
COPY ./poetry.lock /ocr/poetry.lock

WORKDIR /ocr
RUN poetry install

22 changes: 22 additions & 0 deletions OCR/dev-env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
services:
ocr:
build:
context: .
dockerfile: dev-dockerfile
ports:
- "8000:8000"
volumes:
- .:/ocr
restart: no
command: "/bin/sh -c 'poetry install && poetry run fastapi dev ocr/api.py --host 0.0.0.0 --port 8000'"
frontend:
build:
context: ./frontend
dockerfile: dev-dockerfile
ports:
- "5173:5173"
volumes:
- ./frontend:/app
restart: no
command: "/bin/sh -c 'npm install && npm run dev -- --host'"

13 changes: 13 additions & 0 deletions OCR/frontend/dev-dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20.17.0-alpine3.20

RUN apk add --update nodejs npm


COPY . /app

WORKDIR /app
RUN npm install


# CMD npm run dev -- --host
CMD vite

0 comments on commit 0aaf972

Please sign in to comment.