Merge pull request #64 from l-lumin/add-devcontainer-config

feat(devcontainer): Add DevContainer Configuration for Easier Contribution Setup
This commit is contained in:
gagb
2024-12-17 16:52:50 -08:00
committed by GitHub
3 changed files with 42 additions and 4 deletions

View File

@@ -0,0 +1,29 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Existing Dockerfile",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile"
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
"features": {
"ghcr.io/devcontainers-extra/features/hatch:2": {}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root"
}

View File

@@ -1,9 +1,11 @@
FROM python:3.13-alpine
FROM python:3.13-slim-bullseye
USER root
# Runtime dependency
RUN apk add --no-cache ffmpeg
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
RUN pip install markitdown

View File

@@ -103,6 +103,13 @@ hatch shell
hatch test
```
Alternative method: using Devcontainer
- Reopen project in the Devcontainer (via the Command Palette: `Reopen in Container`)
- Once inside the container, run:
```sh
hatch test
```
### Running Pre-commit Checks
Please run the pre-commit checks before submitting a PR.