Skip to content

Commit 3872e37

Browse files
author
Abel Garcia Dorta
committed
chore: implement devcontainers
1 parent 5ba577e commit 3872e37

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM mcr.microsoft.com/devcontainers/typescript-node:20
2+
3+
RUN sudo apt-get update && sudo apt-get install -y pip && sudo pip install awscli awscli-local --break-system-packages
4+
#RUN pip install awscli-local
5+
6+
CMD ["tail", "-f", "/dev/null"]

.devcontainer/devcontainer.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"dockerComposeFile": "docker-compose.yml",
3+
"service": "api",
4+
"workspaceFolder": "/workspace",
5+
"shutdownAction": "stopCompose",
6+
"forwardPorts": [8080],
7+
"postCreateCommand": "yarn install --frozen-lockfile && awslocal sqs create-queue --queue-name localstack-queue",
8+
"customizations": {
9+
"vscode": {
10+
"extensions": [
11+
"dbaeumer.vscode-eslint",
12+
"ms-azuretools.vscode-docker",
13+
"mutantdino.resourcemonitor"
14+
]
15+
}
16+
}
17+
}

.devcontainer/docker-compose.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
version: "3.7"
2+
services:
3+
db:
4+
image: mongo:6.0.15-jammy
5+
environment:
6+
MONGO_INITDB_ROOT_USERNAME: acid
7+
MONGO_INITDB_ROOT_PASSWORD: password
8+
networks:
9+
- ls
10+
11+
aws:
12+
image: localstack/localstack
13+
environment:
14+
SERVICES: sqs
15+
AWS_DEFAULT_REGION: eu-west-1
16+
networks:
17+
ls:
18+
ipv4_address: 10.0.2.20
19+
20+
api:
21+
build:
22+
context: ..
23+
dockerfile: ./.devcontainer/Dockerfile
24+
command: "tail -f /dev/null"
25+
environment:
26+
DB_HOST: db
27+
DB_PORT: 27017
28+
DB_USERNAME: acid
29+
DB_PASSWORD: password
30+
DB_DATABASE: develop
31+
DEPLOY_ENV: dev
32+
AWS_ENDPOINT: http://aws:4566
33+
AWS_ENDPOINT_URL: http://aws:4566
34+
AWS_DEFAULT_REGION: eu-west-1
35+
dns:
36+
- 10.0.2.20
37+
volumes:
38+
- ..:/workspace:cached
39+
networks:
40+
- ls
41+
42+
networks:
43+
ls:
44+
ipam:
45+
config:
46+
- subnet: 10.0.2.0/24

0 commit comments

Comments
 (0)