Skip to content

Commit dce41c0

Browse files
authored
Merge pull request #38 from codeguru42/37-docker-compose
37 docker compose
2 parents ba15a2f + be5a3cb commit dce41c0

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.git
2+
.github
3+
.gitignore
4+
*.sqlite3
5+
cloudformation
6+
deploy.sh
7+
expected
8+
images
9+
*.http

deploy.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
2-
image_hash=$1
3-
account_id=$(aws sts get-caller-identity --query Account --output text)
2+
export image_hash=$1
3+
export account_id=$(aws sts get-caller-identity --query Account --output text)
44
aws ecr get-login-password | docker login --username AWS --password-stdin ${account_id}.dkr.ecr.us-west-1.amazonaws.com \
5-
&& docker stop go-capture \
6-
&& docker rm go-capture \
7-
&& docker run -d --env-file .env -p 8000:8000 --name go-capture ${account_id}.dkr.ecr.us-west-1.amazonaws.com/go-capture:${image_hash} \
5+
&& docker compose down \
6+
&& docker compose up -d

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
api:
3+
image: ${account_id}.dkr.ecr.us-west-1.amazonaws.com/go-capture:${image_hash}
4+
env_file:
5+
- .env
6+
ports:
7+
- 8000:8000

0 commit comments

Comments
 (0)