Skip to content

Commit

Permalink
feat(docker): add support for running cli using docker
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Shatford <[email protected]>
  • Loading branch information
jordanshatford committed Oct 28, 2023
1 parent 9819594 commit 16e9c09
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ Setting up the project using docker is simple. Simply run the following command
docker compose -f docker-compose.dev.yml up --build
```

To run the CLI application using docker you can run the following command:

```sh
docker compose run cli --build
```

> NOTE: using this method will only allow running the project. You must setup the project without docker to be able to generate, format, lint, and check the project.
### Without Docker
Expand Down
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ FROM web-base AS web-production
RUN pnpm web build
CMD [ "pnpm", "web", "preview", "--host", "--port=5173" ]

FROM python:3.12 as cli

# Ensure FFMPEG is available
RUN apt-get update -y
RUN apt-get install -y ffmpeg

WORKDIR /workspace/apps/cli

# Copy core functionality
COPY ./core /workspace/core/

# Install required python packages
COPY ./apps/cli/requirements.txt /workspace/apps/cli/requirements.txt
COPY ./apps/cli/pyproject.toml /workspace/apps/cli/pyproject.toml
COPY ./apps/cli/ydcli /workspace/apps/cli/ydcli
RUN pip install --no-cache-dir -r requirements.txt

ENTRYPOINT [ "python", "ydcli/__main__.py" ]

FROM python:3.12 AS api-base

Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ services:
ALLOWED_ORIGIN: http://localhost:5173
ports:
- 8080:8080
cli:
build:
context: .
target: cli
image: yd/cli:latest
web:
build:
context: .
Expand Down

0 comments on commit 16e9c09

Please sign in to comment.