Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Richard Jones <richard@dagger.io>
- Loading branch information
Richard Jones
committed
Oct 5, 2021
1 parent
35a8644
commit 4c7d90f
Showing
2 changed files
with
26 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
package todoapp | ||
|
||
import ( | ||
"alpha.dagger.io/dagger" | ||
"alpha.dagger.io/docker" | ||
"alpha.dagger.io/dagger" | ||
"alpha.dagger.io/docker" | ||
) | ||
|
||
// run our todoapp in our local Docker engine | ||
run: docker.#Run & { | ||
ref: push.ref | ||
name: "todoapp" | ||
ports: ["8080:80"] | ||
socket: dagger.#Stream & dagger.#Input | ||
ref: push.ref | ||
name: "todoapp" | ||
ports: ["8080:80"] | ||
socket: dagger.#Stream & dagger.#Input | ||
} | ||
|
||
// push to our local registry | ||
// this concrete value satisfies the string constraint | ||
// we defined in the previous file | ||
push: target: "localhost:5000/todoapp" | ||
push: target: "localhost:5000/todoapp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
package todoapp | ||
|
||
import ( | ||
"alpha.dagger.io/dagger" | ||
"alpha.dagger.io/os" | ||
"alpha.dagger.io/docker" | ||
"alpha.dagger.io/js/yarn" | ||
"alpha.dagger.io/dagger" | ||
"alpha.dagger.io/os" | ||
"alpha.dagger.io/docker" | ||
"alpha.dagger.io/js/yarn" | ||
) | ||
|
||
// Build the source code using Yarn | ||
app: yarn.#Package & { | ||
"source": dagger.#Artifact & dagger.#Input | ||
"source": dagger.#Artifact & dagger.#Input | ||
} | ||
|
||
// package the static HTML from yarn into a Docker image | ||
image: os.#Container & { | ||
image: docker.#Pull & { | ||
from: "nginx" | ||
} | ||
image: docker.#Pull & { | ||
from: "nginx" | ||
} | ||
|
||
// app.build references our app key above | ||
// which infers a dependency that Dagger | ||
// uses to generate the DAG | ||
copy: "/usr/share/nginx/html": from: app.build | ||
// app.build references our app key above | ||
// which infers a dependency that Dagger | ||
// uses to generate the DAG | ||
copy: "/usr/share/nginx/html": from: app.build | ||
} | ||
|
||
// push the image to a registry | ||
push: docker.#Push & { | ||
// leave target blank here so that different | ||
// environments can push to different registries | ||
target: string | ||
// leave target blank here so that different | ||
// environments can push to different registries | ||
target: string | ||
|
||
// the source of our push resource | ||
// is the image resource we declared above | ||
source: image | ||
} | ||
// the source of our push resource | ||
// is the image resource we declared above | ||
source: image | ||
} |