Skip to content

Commit

Permalink
add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
voigt committed Oct 13, 2023
1 parent 2c1dc8d commit 6be453a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
include:
- dockerfile: ./example-1-sidecars/Dockerfile
image: ghcr.io/Liquid-Reply/k8s-spin/spin-static-server
- dockerfile: ./example-1-sidecars/Dockerfile
image: ghcr.io/Liquid-Reply/k8s-spin/spin-redis
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -55,7 +57,6 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
file: ${{ matrix.dockerfile }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
# ghcr.io/${{ env.IMAGE_NAME }}:latest
# ghcr.io/${{ env.IMAGE_NAME }}:${{ github.sha }}
# ${{ steps.meta.outputs.tags }}
tags: |
${{ matrix.image }}:latest
${{ steps.meta.outputs.tags }}
3 changes: 3 additions & 0 deletions example-2-redis/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM scratch
COPY ./example-2-redis/spin.toml ./spin.toml
COPY ../bin/env_explorer.wasm ./env_explorer.wasm
42 changes: 42 additions & 0 deletions example-2-redis/spin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
spin_version = "1"
authors = ["Radu Matei <[email protected]>"]
description = ""
name = "kv-explorer"
trigger = { type = "http", base = "/" }
version = "0.1.0"


# [[component]]
# id = "golang-explorer"
# source = "explorer/main.wasm"
# allowed_http_hosts = []
# key_value_stores = ["default"]
# [component.trigger]
# route = "/internal/kv-explorer/..."
# [component.build]
# command = "tinygo build -target=wasi -gc=leaking -o main.wasm main.go"
# workdir = "explorer"
# watch = ["**/*.go", "go.mod"]

[variables]
environment = { default = "local" }

[[component]]
id = "env-explorer"
source = "env_explorer.wasm"
environment = { "API_URL" = "http://envvars:8080/api", "CA_URL" = "http://envvars:8080/api", "DA" = "http://envvars:8080/api" }
files = [
# "./**/*" # Doesn't work in k8s
{ source = "env-explorer", destination = "/env-explorer" },
]
allowed_http_hosts = []
key_value_stores = ["default"]
[component.config]
environment = "{{ environment }}"
[component.trigger]
route = "/..."
# route = "/internal/env-explorer/..."
[component.build]
command = "cargo build --target wasm32-wasi --release"
workdir = "env-explorer"
watch = ["src/**/*.rs", "Cargo.toml"]

0 comments on commit 6be453a

Please sign in to comment.