Skip to content

Commit

Permalink
feat: docker scratch image, move deploy to own justfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mentos1386 committed Jun 3, 2024
1 parent 883ec38 commit a7f33a4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gcr.io/distroless/static-debian12:latest as production
FROM scratch
ARG TARGETARCH
ARG TARGETOS

Expand Down
17 changes: 0 additions & 17 deletions build/Justfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
# Deploy the application to fly.io
deploy-fly:
fly deploy --ha=false -c deploy/fly.toml -i {{DOCKER_IMAGE}}

# Read local jwt key and set it as fly secret
deploy-fly-set-jwt-key-secrets:
#!/bin/bash
# https://github.com/superfly/flyctl/issues/589
cat <<EOF | fly secrets import -c deploy/fly.toml
JWT_PRIVATE_KEY="""{{JWT_PRIVATE_KEY}}"""
JWT_PUBLIC_KEY="""{{JWT_PUBLIC_KEY}}"""
EOF

# Deploy locally with docker compose
deploy-docker: build-docker
docker compose --file dpeloy/docker-compose.yaml up

# Build the application
build: build-bin build-docker

Expand Down
16 changes: 16 additions & 0 deletions deploy/Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Deploy the application to fly.io
deploy-fly:
fly deploy --ha=false -c deploy/fly.toml -i {{DOCKER_IMAGE}}

# Read local jwt key and set it as fly secret
deploy-fly-set-jwt-key-secrets:
#!/bin/bash
# https://github.com/superfly/flyctl/issues/589
cat <<EOF | fly secrets import -c deploy/fly.toml
JWT_PRIVATE_KEY="""{{JWT_PRIVATE_KEY}}"""
JWT_PUBLIC_KEY="""{{JWT_PUBLIC_KEY}}"""
EOF

# Deploy locally with docker compose
deploy-docker: build-docker
docker compose --file dpeloy/docker-compose.yaml up
7 changes: 7 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ARCH := "amd64 arm64"

export CGO_ENABLED := "0"
import 'build/Justfile'
import 'deploy/Justfile'

_default:
@just --list
Expand Down Expand Up @@ -86,6 +87,12 @@ migration-new name:
echo "Created migration file: $FILENAME"

update-dependencies:
# Updating temporal dependencies is a bit tricky
# as finding the right combination of api, server and ui-server
# that work together is not easy.
# Any version of ui-server > 2.23.0 < 2.27.2 is broken for us.
# Using latest of everything results (at the time of writing) in to
# working server but broken ui-server (404 when it tries to list namespaces).
go get -u -t \
go.k6.io/k6@v0.51.0 \
github.com/temporalio/ui-server/v2@v2.23.0 \
Expand Down

0 comments on commit a7f33a4

Please sign in to comment.