forked from ScuffleCloud/scuffle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added docker build images and docker compose stack to allow for local stack running. closes ScuffleCloud#25
- Loading branch information
1 parent
85a545b
commit 657ebc7
Showing
30 changed files
with
386 additions
and
30 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[build] | ||
target = "x86_64-unknown-linux-musl" |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.vscode/ | ||
node_modules/ | ||
.env* | ||
Dockerfile | ||
dev-stack/ | ||
.dockerignore |
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ target/ | |
.vscode/ | ||
!.vscode/extensions.json | ||
node_modules/ | ||
.env | ||
.env* | ||
dev-stack/stack.docker-compose.yaml |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
version: "3.1" | ||
|
||
services: | ||
api: | ||
build: | ||
context: .. | ||
dockerfile: docker/api.Dockerfile | ||
ports: | ||
- "8080:8080" | ||
environment: | ||
- SCUF_DATABASE_URL=postgres://postgres:postgres@postgres:5432/scuffle-dev | ||
frontend: | ||
build: | ||
context: .. | ||
dockerfile: docker/frontend.Dockerfile | ||
ports: | ||
- "4000:4000" | ||
edge: | ||
build: | ||
context: .. | ||
dockerfile: docker/edge.Dockerfile | ||
ingest: | ||
build: | ||
context: .. | ||
dockerfile: docker/ingest.Dockerfile | ||
transcoder: | ||
build: | ||
context: .. | ||
dockerfile: docker/transcoder.Dockerfile | ||
|
||
networks: | ||
default: | ||
name: scuffle-dev | ||
external: true |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM scratch | ||
|
||
COPY target/x86_64-unknown-linux-musl/release/api /app/ | ||
|
||
STOPSIGNAL SIGINT | ||
|
||
ENTRYPOINT ["/app/api"] |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# syntax = docker/dockerfile:1.4 | ||
FROM rust:1.66.1-alpine3.17 | ||
|
||
RUN <<eot | ||
# Install all dependencies for building the backend and frontend | ||
|
||
# CVEs fixed in 3.0.8-r0 | ||
apk add --no-cache libssl3=3.0.8-r0 libcrypto3=3.0.8-r0 openssl-dev=3.0.8-r0 | ||
|
||
# We need to install nodejs to build the frontend | ||
apk add --no-cache nodejs=18.14.1-r0 yarn=1.22.19-r0 | ||
|
||
# We need to install just to use our build script | ||
apk add --no-cache just=1.8.0-r0 musl-dev=1.2.3-r4 curl=7.87.0-r2 | ||
|
||
# Install wasm-pack | ||
yarn global add wasm-pack | ||
|
||
# Add wasm build target | ||
rustup target add wasm32-unknown-unknown | ||
|
||
# Clean up cache files | ||
rm -r /usr/local/cargo/registry | ||
yarn cache clean | ||
eot |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM scratch | ||
|
||
COPY target/x86_64-unknown-linux-musl/release/edge /app/ | ||
|
||
STOPSIGNAL SIGINT | ||
|
||
ENTRYPOINT ["/app/edge"] |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM denoland/deno:alpine-1.30.3 | ||
|
||
# CVEs fixed in 3.0.8-r0 | ||
RUN apk add --no-cache libssl3=3.0.8-r0 libcrypto3=3.0.8-r0 | ||
|
||
COPY frontend/website/server.ts /app/ | ||
COPY frontend/website/build /app/build | ||
|
||
WORKDIR /app | ||
|
||
RUN deno cache --unstable server.ts | ||
|
||
STOPSIGNAL SIGINT | ||
|
||
ENTRYPOINT ["deno", "run", "--allow-env", "--allow-read", "--allow-net", "server.ts"] |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM scratch | ||
|
||
COPY target/x86_64-unknown-linux-musl/release/ingest /app/ | ||
|
||
STOPSIGNAL SIGINT | ||
|
||
ENTRYPOINT ["/app/ingest"] |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM scratch | ||
|
||
COPY target/x86_64-unknown-linux-musl/release/transcoder /app/ | ||
|
||
STOPSIGNAL SIGINT | ||
|
||
ENTRYPOINT ["/app/transcoder"] |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.DS_Store | ||
node_modules | ||
/build | ||
/.svelte-kit | ||
/package | ||
.env | ||
.env.* | ||
vite.config.js.timestamp-* | ||
vite.config.ts.timestamp-* | ||
wasm.d.ts |
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Application, Router } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { handler } from "./build/handler.js"; | ||
|
||
const app = new Application(); | ||
|
||
// add a route that lives separately from the SvelteKit app | ||
const router = new Router(); | ||
|
||
router.get("/healthcheck", (ctx) => { | ||
ctx.response.body = "ok"; | ||
}); | ||
|
||
app.use(router.routes()); | ||
app.use(router.allowedMethods()); | ||
|
||
// let SvelteKit handle everything else, including serving prerendered pages and static assets | ||
app.use(handler); | ||
|
||
app.addEventListener("listen", () => { | ||
console.log("listening on port 3000"); | ||
}); | ||
|
||
const shutdownHandler = () => { | ||
console.log("interrupted!"); | ||
Deno.exit(); | ||
}; | ||
|
||
Deno.addSignalListener("SIGINT", shutdownHandler); | ||
Deno.addSignalListener("SIGTERM", shutdownHandler); | ||
|
||
await app.listen({ port: 3000 }); |
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
Oops, something went wrong.