Skip to content

Commit

Permalink
Add docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
bh2smith committed Dec 6, 2024
1 parent f10d097 commit 77235c8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FROM python:3.13-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
make \
docker-compose \
&& rm -rf /var/lib/apt/lists/*

# Create non-root user
Expand All @@ -14,7 +17,6 @@ RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& apt-get update \
&& apt-get install -y sudo \
&& sudo apt-get install make \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

Expand All @@ -30,7 +32,8 @@ RUN pip install --no-cache-dir \
pylint \
isort \
pytest \
pytest-cov
pytest-cov \
ruff

# Switch to non-root user
USER $USERNAME
Expand Down
12 changes: 10 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "Dune Sync Development",
"dockerFile": "Dockerfile",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -9,7 +12,8 @@
"ms-python.pylint",
"ms-python.black-formatter",
"ms-python.isort",
"eamodio.gitlens"
"eamodio.gitlens",
"ms-azuretools.vscode-docker"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
Expand All @@ -25,5 +29,9 @@
}
},
"postCreateCommand": "python -m poetry install",
"remoteUser": "vscode"
"remoteUser": "vscode",
"runArgs": ["--privileged"],
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
]
}

0 comments on commit 77235c8

Please sign in to comment.