From 138ab9aef5df0fe807b8ef17ddaefce6d13863f0 Mon Sep 17 00:00:00 2001 From: sumeshi Date: Sun, 30 Oct 2022 19:16:27 +0900 Subject: [PATCH] feat: add dockerfiles --- .devcontainer/Dockerfile | 8 ++++++++ .devcontainer/devcontainer.json | 20 ++++++++++++++++++++ .devcontainer/postCreateCommands.sh | 6 ++++++ Dockerfile | 2 +- docker-compose.yml | 18 ++++++++++++++++++ 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/postCreateCommands.sh create mode 100644 docker-compose.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..231cff8 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.9.15-bullseye + +RUN apt -y update && apt upgrade -qqy && apt -y install \ + curl \ + gcc \ + git + +RUN pip install -U pip && pip install poetry diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..a61230f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,20 @@ +{ + "name": "dev", + "dockerFile": "Dockerfile", + "postCreateCommand": "/bin/sh ./.devcontainer/postCreateCommands.sh", + "extensions": [ + "ms-azuretools.vscode-docker", + "ms-python.python", + "ms-python.vscode-pylance" + ], + "settings": { + "python.linting.flake8Enabled": true, + "python.formatting.provider": "black", + "[python]": { + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": true + } + }, + } +} \ No newline at end of file diff --git a/.devcontainer/postCreateCommands.sh b/.devcontainer/postCreateCommands.sh new file mode 100644 index 0000000..5c154d3 --- /dev/null +++ b/.devcontainer/postCreateCommands.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +poetry config virtualenvs.in-project true +poetry install + +echo 'Welcome to the ntfsdump development environment!' \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 6ff9962..18045c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-buster +FROM python:3.9-bullseye # install from pypi WORKDIR /app diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ca62c95 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3.8" + +# It can also be run from docker-compose by specifying the following options. +# Note that only the current directory can be specified as a target. +# +# $ ARGUMENTS="'/$MFT' ./path/to/imagefile" docker-compose up + +services: + app: + container_name: ntfsdump + build: + context: ./ + dockerfile: Dockerfile + volumes: + - .:/app + environment: + - ARGUMENTS="-h" + command: ${ARGUMENTS} \ No newline at end of file