Skip to content

Commit 38baaf9

Browse files
author
Andrea Scuderi
committed
Add initial commit
1 parent 4c37a3a commit 38baaf9

File tree

10 files changed

+461
-30
lines changed

10 files changed

+461
-30
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM swift:6.2.0
2+
3+
# Add make installation
4+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5+
&& apt-get -y install --no-install-recommends make

.devcontainer/devcontainer.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
"customizations": {
23+
// Configure properties specific to VS Code.
24+
"vscode": {
25+
// Set *default* container specific settings.json values on container create.
26+
"settings": {
27+
"lldb.library": "/usr/lib/liblldb.so"
28+
},
29+
// Add the IDs of extensions you want installed when the container is created.
30+
"extensions": [
31+
"swiftlang.swift-vscode"
32+
]
33+
}
34+
}
35+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
36+
// "forwardPorts": [],
37+
38+
// Use 'postCreateCommand' to run commands after the container is created.
39+
// "postCreateCommand": "docker --version",
40+
41+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
42+
// "remoteUser": "root"
43+
}

.devcontainer/docker-compose.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
35+
localstack:
36+
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

.gitignore

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,8 @@ playground.xcworkspace
2727
#
2828
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
2929
# hence it is not needed unless you have added a package configuration file to your project
30-
# .swiftpm
30+
.swiftpm
3131

3232
.build/
3333

34-
# CocoaPods
35-
#
36-
# We recommend against adding the Pods directory to your .gitignore. However
37-
# you should judge for yourself, the pros and cons are mentioned at:
38-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
39-
#
40-
# Pods/
41-
#
42-
# Add this line if you want to avoid checking in source code from the Xcode workspace
43-
# *.xcworkspace
44-
45-
# Carthage
46-
#
47-
# Add this line if you want to avoid checking in source code from Carthage dependencies.
48-
# Carthage/Checkouts
49-
50-
Carthage/Build/
51-
52-
# fastlane
53-
#
54-
# It is recommended to not store the screenshots in the git repo.
55-
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
56-
# For more information about the recommended setup visit:
57-
# https://docs.fastlane.tools/best-practices/source-control/#source-control
58-
59-
fastlane/report.xml
60-
fastlane/Preview.html
61-
fastlane/screenshots/**/*.png
62-
fastlane/test_output
34+
Package.resolved

.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+
}

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
localstack_create_dynamo_db_table:
2+
aws --endpoint-url=http://localstack:4566 dynamodb create-table \
3+
--table-name Breeze \
4+
--attribute-definitions AttributeName=itemKey,AttributeType=S \
5+
--key-schema AttributeName=itemKey,KeyType=HASH \
6+
--billing-mode PAY_PER_REQUEST \
7+
--region us-east-1

Package.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// swift-tools-version: 6.2
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "SwiftInDevContainer",
8+
dependencies: [
9+
.package(url: "https://github.com/soto-project/soto.git", from: "7.0.0"),
10+
],
11+
targets: [
12+
// Targets are the basic building blocks of a package, defining a module or a test suite.
13+
// Targets can depend on other targets in this package and products from dependencies.
14+
.executableTarget(
15+
name: "SwiftInDevContainer",
16+
dependencies: [
17+
.product(name: "SotoDynamoDB", package: "soto"),
18+
]
19+
),
20+
]
21+
)

0 commit comments

Comments
 (0)