Skip to content

Commit

Permalink
feat/add-devcontainers-support
Browse files Browse the repository at this point in the history
  • Loading branch information
SafetyQuincyF committed Oct 16, 2024
1 parent 07bc5b7 commit 191edd2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.12-slim

# Create directory for the application
RUN mkdir /app

# Install necessary dependencies
RUN apt-get update && apt-get -y install docker.io jq git && apt-get clean && rm -rf /var/lib/apt/lists/*

# Copy your project files into the container (relative to the build context)
COPY .. /app/

# Set the working directory
WORKDIR /app

# Set environment variables
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENV PYTHONPATH="/app"
22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Safety-CLI Dev Container",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"SAFETY_VERSION": "DEV"
}
},
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.debugpy"
],
"postCreateCommand": "pip install -r test_requirements.txt && pip install ruff requests pre-commit",
"remoteUser": "root",
"workspaceFolder": "/workspaces/safety",
"forwardPorts": [49152]
}

0 comments on commit 191edd2

Please sign in to comment.