From 51f7100a3ffcdf2b674df3600b380ed586c01eb1 Mon Sep 17 00:00:00 2001 From: NeonXP Date: Sat, 27 Jan 2024 05:28:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B8=D0=BC=D0=B5=D1=80=D1=8B=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devcontainer.json | 24 ++++++++++++++++++++++++ docker-compose.yml | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 devcontainer.json create mode 100644 docker-compose.yml diff --git a/devcontainer.json b/devcontainer.json new file mode 100644 index 0000000..f713571 --- /dev/null +++ b/devcontainer.json @@ -0,0 +1,24 @@ +{ + "name": "Go environment", + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", + "forwardPorts": [5432, 8000], + "remoteUser": "vscode", + "customizations": { + "vscode": { + "extensions": [ + "golang.go", + "neonxp.gotools", + "r3inbowari.gomodexplorer", + "ms-vscode.makefile-tools", + "redhat.vscode-yaml", + "humao.rest-client", + "mtxr.sqltools", + "mtxr.sqltools-driver-pg", + "codezombiech.gitignore", + "ms-azuretools.vscode-docker" + ] + } + } +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4a959ae --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +version: '3.8' + +volumes: + postgres-data: + +services: + app: + build: + context: . + dockerfile: Dockerfile + env_file: + - .env + volumes: + - ../..:/workspaces:cached + command: sleep infinity + network_mode: service:db + + db: + image: postgres:15-alpine3.17 + restart: unless-stopped + volumes: + - postgres-data:/var/lib/postgresql/data + env_file: + - .env