Skip to content

Commit cf7d7e7

Browse files
author
Andrea Scuderi
committed
Add Dev Container config
1 parent cafc954 commit cf7d7e7

File tree

5 files changed

+101
-0
lines changed

5 files changed

+101
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Note: You can use any Debian/Ubuntu based image you want.
2+
FROM swift:6.2.0
3+
4+
# [Optional] Uncomment this section to install additional OS packages.
5+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
6+
&& apt-get -y install --no-install-recommends make

.devcontainer/devcontainer.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-outside-of-docker-compose
3+
{
4+
"name": "Docker from Docker Compose",
5+
"dockerComposeFile": "docker-compose.yml",
6+
"service": "app",
7+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
8+
9+
// Use this environment variable if you need to bind mount your local source code into a new container.
10+
"remoteEnv": {
11+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
12+
},
13+
14+
"features": {
15+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
16+
"version": "latest",
17+
"enableNonRootDocker": "true",
18+
"moby": "true"
19+
},
20+
"ghcr.io/devcontainers/features/aws-cli:1": {}
21+
},
22+
23+
// Configure tool-specific properties.
24+
"customizations": {
25+
// Configure properties specific to VS Code.
26+
"vscode": {
27+
// Set *default* container specific settings.json values on container create.
28+
"settings": {
29+
"lldb.library": "/usr/lib/liblldb.so"
30+
},
31+
// Add the IDs of extensions you want installed when the container is created.
32+
"extensions": [
33+
"swiftlang.swift-vscode"
34+
]
35+
}
36+
}
37+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
38+
// "forwardPorts": [],
39+
40+
// Use 'postCreateCommand' to run commands after the container is created.
41+
// "postCreateCommand": "docker --version",
42+
43+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
44+
// "remoteUser": "root"
45+
}

.devcontainer/docker-compose.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
version: '3'
2+
3+
services:
4+
app:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
9+
volumes:
10+
# Forwards the local Docker socket to the container.
11+
- /var/run/docker.sock:/var/run/docker-host.sock
12+
# Update this to wherever you want VS Code to mount the folder of your project
13+
- ../..:/workspaces:cached
14+
15+
# Overrides default command so things don't shut down after the process ends.
16+
entrypoint: /usr/local/share/docker-init.sh
17+
depends_on:
18+
- localstack
19+
environment:
20+
- LOCALSTACK_ENDPOINT=http://localstack:4566
21+
- AWS_ACCESS_KEY_ID=test
22+
- AWS_SECRET_ACCESS_KEY=test
23+
- AWS_REGION=us-east-1
24+
command: sleep infinity
25+
26+
# Uncomment the next four lines if you will use a ptrace-based debuggers like C++, Go, and Rust.
27+
cap_add:
28+
- SYS_PTRACE
29+
security_opt:
30+
- seccomp:unconfined
31+
32+
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
33+
# (Adding the "ports" property to this file will not forward from a Codespace.)
34+
localstack:
35+
image: localstack/localstack

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for more information:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
# https://containers.dev/guide/dependabot
6+
7+
version: 2
8+
updates:
9+
- package-ecosystem: "devcontainers"
10+
directory: "/"
11+
schedule:
12+
interval: weekly

.sourcekit-lsp/config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/swiftlang/sourcekit-lsp/refs/heads/release/6.2/config.schema.json"
3+
}

0 commit comments

Comments
 (0)