Skip to content

Commit

Permalink
Feature/update start.sh.v2 (#8)
Browse files Browse the repository at this point in the history
* Update start.sh configuration

* Update stash.sh and stuffs configuration
  • Loading branch information
TriSBie authored Aug 23, 2024
1 parent 9dbc93d commit 22b18b8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
- name: Load secrets and save to .env
run: aws secretsmanager get-secret-value --secret-id simple_bank_secret --query SecretString --output text | jq -r 'to_entries|map("\(.key)=\(.value)")|.[]' > app.env

- name: Debug: Check app.env content
run: cat app.env

- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ WORKDIR /app
COPY --from=builder /app/main .
# copy the migrate binary file from the build stage to the run stage
COPY --from=builder /app/migrate ./migrate
COPY app.env .
COPY app.env /app/app.env
COPY start.sh .
COPY wait-for.sh .

COPY db/migration ./migration

RUN chmod +x /app/start.sh
RUN chmod +x /app/wait-for.sh
RUN chmod 644 /app/app.env

EXPOSE 8080

Expand Down
2 changes: 1 addition & 1 deletion app.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DB_DRIVER=postgres
DB_SOURCE=postgresql://root:secret@localhost:5432/simple_bank?sslmode=disable
SERVER_ADDRESS=0.0.0.0:8082
SERVER_ADDRESS=0.0.0.0:8080
TOKEN_SYMMETRIC_KEY=5e2343a49891c39e89b4de57ac68ea9f
ACCESS_TOKEN_DURATION=15m
1 change: 1 addition & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set -a
set +a

grep -v '^#' app.env | grep -v '^$'
env | grep DB_SOURCE

# Debugging: Print the DB_SOURCE to ensure it is loaded
echo "DB_SOURCE is $DB_SOURCE"
Expand Down

0 comments on commit 22b18b8

Please sign in to comment.