From a5fe1eae0edf08b25657cd516077aa76e50b8420 Mon Sep 17 00:00:00 2001
From: Robin Mackaij <r.a.mackaij@gmail.com>
Date: Mon, 12 Feb 2024 13:06:19 +0100
Subject: [PATCH] devcontainer added

---
 .devcontainer/Dockerfile        | 15 +++++++++++++++
 .devcontainer/devcontainer.json | 34 +++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)
 create mode 100644 .devcontainer/Dockerfile
 create mode 100644 .devcontainer/devcontainer.json

diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644
index 0000000..46e4563
--- /dev/null
+++ b/.devcontainer/Dockerfile
@@ -0,0 +1,15 @@
+FROM python:3.12-slim-bookworm
+
+RUN pip install --upgrade pip
+
+# poetry install into the default Python interpreter since we're in a container
+RUN pip install poetry
+RUN poetry config virtualenvs.create false
+RUN poetry config virtualenvs.in-project false
+
+# Copy the pyproject.toml and poetry.lock file to be able to install dependencies using poetry
+COPY pyproject.toml pyproject.toml
+COPY poetry.lock poetry.lock
+
+EXPOSE 8888
+ENTRYPOINT /bin/sh
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 0000000..2431c13
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,34 @@
+// 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": "Local 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",
+		"args": {
+		}
+	},
+    "postCreateCommand": "poetry install",
+	// Configure tool-specific properties.
+	"customizations": {
+		"vscode": {
+			// Set *default* container specific settings.json values on container create.
+			"settings": {
+                "robotcode.robot.variables": {
+                    "ROOT": "/workspaces/robotframework-openapidriver"
+                }
+            },
+            "extensions": [
+				"ms-python.python",
+				"ms-python.vscode-pylance",
+                "charliermarsh.ruff",
+                "d-biehl.robotcode",
+                "ms-azuretools.vscode-docker",
+                "Gruntfuggly.todo-tree",
+                "shardulm94.trailing-spaces"
+			]
+		}
+	}
+}
\ No newline at end of file