Skip to content

Commit

Permalink
Merge pull request #70 from gadget-inc/update_dockerfile
Browse files Browse the repository at this point in the history
Update dockerfile
  • Loading branch information
angelini authored Dec 5, 2023
2 parents 1acefac + b4bb662 commit 7dd7c0c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM --platform=linux/amd64 registry.fedoraproject.org/fedora-minimal:37
FROM --platform=linux/amd64 registry.fedoraproject.org/fedora-minimal:40

RUN microdnf install -y curl findutils gzip iputils less postgresql procps shadow-utils tar time which \
&& microdnf clean all

RUN GRPC_HEALTH_PROBE_VERSION=v0.4.15 \
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.23 \
&& curl -Lfso /bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 \
&& chmod +x /bin/grpc_health_probe

RUN GO_MIGRATE_VERSION=v4.15.2 \
RUN GO_MIGRATE_VERSION=v4.16.2 \
&& curl -Lfso /tmp/migrate.tar.gz https://github.com/golang-migrate/migrate/releases/download/${GO_MIGRATE_VERSION}/migrate.linux-amd64.tar.gz \
&& tar -xzf /tmp/migrate.tar.gz -C /bin \
&& chmod +x /bin/migrate
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SERVICE := $(PROJECT).server
.PHONY: reset-db setup-local server server-profile install-js
.PHONY: client-update client-large-update client-get client-rebuild client-rebuild-with-cache
.PHONY: client-getcache client-gc-contents client-gc-project client-gc-random-projects
.PHONY: health upload-container-image gen-docs
.PHONY: health upload-container-image run-container gen-docs
.PHONY: load-test-new load-test-get load-test-update

install:
Expand Down Expand Up @@ -201,6 +201,10 @@ else
docker push gcr.io/gadget-core-production/dateilager:latest
endif

run-container: release
docker build -t dl-local:latest .
docker run --rm -it -p 127.0.0.1:$(GRPC_PORT):$(GRPC_PORT)/tcp -v ./development:/home/main/secrets/tls -v ./development:/home/main/secrets/paseto dl-local:latest $(GRPC_PORT) "postgres://$(DB_USER):$(DB_PASS)@host.docker.internal:5432" dl

gen-docs:
go run cmd/gen-docs/main.go

Expand Down
6 changes: 4 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -euo pipefail

export DL_ENV="${DL_ENV:-dev}"

log() {
echo "$(date +"%H:%M:%S") - $(printf '%s' "$@")" 1>&2
}
Expand All @@ -16,7 +18,7 @@ error() {
wait_for_postgres() {
local dburi="${1}"

log "wait for postgres"
log "wait for postgres ${dburi}"

until psql "${dburi}" -c '\q' 2> /dev/null; do
sleep 1
Expand Down Expand Up @@ -74,7 +76,7 @@ main() {
local secrets="${HOME}/secrets"

log "start dateilager server"
"${HOME}/server" -dburi "${appdb}" -port "${port}" -log "${log_level}" -cert "${secrets}/server.crt" -key "${secrets}/server.key" -paseto "${secrets}/paseto.pub"
"${HOME}/server" --dburi "${appdb}" --port "${port}" --log-level "${log_level}" --cert "${secrets}/tls/server.crt" --key "${secrets}/tls/server.key" --paseto "${secrets}/paseto/paseto.pub"
}

main "$@"

0 comments on commit 7dd7c0c

Please sign in to comment.