Skip to content

Commit d42387e

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

File tree

10 files changed

+71
-174
lines changed

10 files changed

+71
-174
lines changed

.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",
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: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
volumes:
9+
- db-data:/data/db
10+
networks:
11+
- ls
12+
13+
aws:
14+
image: localstack/localstack
15+
environment:
16+
SERVICES: sqs
17+
AWS_DEFAULT_REGION: eu-west-1
18+
volumes:
19+
- "./init-aws.sh:/etc/localstack/init/ready.d/init-aws.sh"
20+
networks:
21+
ls:
22+
ipv4_address: 10.0.2.20
23+
24+
api:
25+
image: mcr.microsoft.com/devcontainers/typescript-node:20
26+
command: sleep infinity
27+
environment:
28+
DB_HOST: db
29+
DB_PORT: 27017
30+
DB_USERNAME: acid
31+
DB_PASSWORD: password
32+
DB_DATABASE: develop
33+
DEPLOY_ENV: dev
34+
AWS_ENDPOINT: http://aws:4566
35+
AWS_ENDPOINT_URL: http://aws:4566
36+
AWS_DEFAULT_REGION: eu-west-1
37+
dns:
38+
- 10.0.2.20
39+
volumes:
40+
- ..:/workspace:cached
41+
networks:
42+
- ls
43+
44+
networks:
45+
ls:
46+
ipam:
47+
config:
48+
- subnet: 10.0.2.0/24
49+
50+
volumes:
51+
db-data:

.devcontainer/init-aws.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
awslocal sqs create-queue --queue-name localstack-queue

.github/workflows/main.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,5 @@ jobs:
104104
- name: Build and push docker image
105105
uses: docker/build-push-action@v5
106106
with:
107-
context: .
108-
file: ./docker/Dockerfile
109107
push: false
110108
tags: nestjs:latest

.github/workflows/pull_request.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,5 @@ jobs:
112112
- name: Build and push docker image
113113
uses: docker/build-push-action@v5
114114
with:
115-
context: .
116-
file: ./docker/Dockerfile
117115
push: false
118116
tags: nestjs:latest
File renamed without changes.

docker-compose.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

docker/Dockerfile.dev

Lines changed: 0 additions & 18 deletions
This file was deleted.

docker/entrypoint.local.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

docker/wait-for.sh

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)