Skip to content

Commit

Permalink
Merge pull request #7 from wiemanboy/fix/docker-compose
Browse files Browse the repository at this point in the history
Fix/docker compose
  • Loading branch information
wiemanboy authored Jul 30, 2024
2 parents 6b8d06a + dd43a1d commit 3aced6b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o /build
FROM golang:alpine

COPY --from=builder /build /build
COPY read_secrets.sh /read_secrets.sh

ENV PORT=8000

EXPOSE $PORT

CMD ["/build"]
ENTRYPOINT ["/read_secrets.sh", "/build"]
12 changes: 7 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
services:
blobstore:
build:
context: ./dev/blobstore
dockerfile: Dockerfile
image: minio/minio
environment:
MINIO_ROOT_USER: "username"
MINIO_ROOT_PASSWORD: "password"
Expand All @@ -13,7 +11,7 @@ services:
- ./dev/minio/data:/data
command: server /data --console-address ":9001"

wiemancdn:
wiemanimages:
build:
context: .
dockerfile: Dockerfile
Expand All @@ -24,4 +22,8 @@ services:
ACCESS_KEY_ID: "username"
SECRET_ACCESS_KEY: "password"
BUCKET_NAME: "test-bucket"
REGION: "s-east-1"
REGION: "s-east-1"
JWT_SECRET: "secret"
JWT_EXPIRATION_TIME: "1000000"
ADMIN_USERNAME: "admin"
ADMIN_PASSWORD: "admin"
13 changes: 13 additions & 0 deletions read_secrets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

for var in $(env); do
if echo "$var" | grep -q '_FILE='; then
var_name=$(echo "$var" | cut -d'=' -f1 | sed 's/_FILE$//')
file_path=$(echo "$var" | cut -d'=' -f2)
if [ -f "$file_path" ]; then
export "$var_name"="$(cat "$file_path")"
fi
fi
done

exec "$@"

0 comments on commit 3aced6b

Please sign in to comment.