Skip to content

Commit

Permalink
feat(project-dev): 🧑‍💻 add dev containers settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ilbumi committed Aug 20, 2023
1 parent 4421cf9 commit 60fba44
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
7 changes: 6 additions & 1 deletion copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,9 @@ python_package_import_name:
python_package_command_line_name:
type: str
help: Your CLI name if any (for use in the shell)
default: "{{ project_name | slugify }}"
default: "{{ project_name | slugify }}"

docker-base-image:
type: str
help: Base image for the dev container. Edit Dockerfile.dev if your image is not ubuntu-based or have no python installed.
default: "{{ python:3.11 }}"
12 changes: 12 additions & 0 deletions project/.devcontainer/Dockerfile.dev.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ARG BASE_IMAGE={{ docker-base-image }}
FROM ${BASE_IMAGE}
RUN apt-get update \
&& apt-get install build-essential git gcc -y \
&& apt-get clean

RUN pip install -U pip setuptools wheel
RUN pip install pdm

RUN mkdir /data

CMD ""
22 changes: 22 additions & 0 deletions project/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// 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": "Development docker containers",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/app",
"shutdownAction": "stopCompose",
"overrideCommand": true,
"customizations": {
"vscode": {
"extensions": [
"vivaxy.vscode-conventional-commits",
"DavidAnson.vscode-markdownlint",
"ionutvmi.path-autocomplete",
"ms-python.vscode-pylance",
"ms-python.python",
"ms-python.black-formatter"
]
}
}
}
12 changes: 12 additions & 0 deletions project/.devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3.8"

services:
app:
build:
context: ..
dockerfile: .devcontainer/Dockerfile.dev
env_file:
- .env
command: "/bin/sh -c \"while sleep 1000; do :; done\""
volumes:
- "../:/app"

0 comments on commit 60fba44

Please sign in to comment.