mirror of
https://github.com/seemueller-io/cluster.git
synced 2025-09-08 22:56:46 +00:00
example services contains a default nginx server for simplicity
This commit is contained in:
@@ -1,38 +0,0 @@
|
|||||||
FROM rust:1-slim-bookworm as build
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Install build dependencies
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
clang \
|
|
||||||
build-essential \
|
|
||||||
pkg-config \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Add wasm32 target for Cloudflare Workers
|
|
||||||
RUN rustup target add wasm32-unknown-unknown
|
|
||||||
|
|
||||||
# Copy project files
|
|
||||||
COPY Cargo.toml Cargo.lock ./
|
|
||||||
COPY wrangler.jsonc ./
|
|
||||||
COPY src/ ./src/
|
|
||||||
|
|
||||||
# Install worker-build and build the project
|
|
||||||
RUN cargo install -q worker-build && worker-build --release
|
|
||||||
|
|
||||||
FROM node:20-slim
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Install wrangler
|
|
||||||
RUN npm install -g wrangler
|
|
||||||
|
|
||||||
# Copy built files from build stage
|
|
||||||
COPY --from=build /app/build ./build
|
|
||||||
COPY --from=build /app/wrangler.jsonc ./
|
|
||||||
|
|
||||||
EXPOSE 8787
|
|
||||||
|
|
||||||
HEALTHCHECK CMD curl --fail http://localhost:8787 || exit 1
|
|
||||||
|
|
||||||
ENTRYPOINT ["wrangler", "dev"]
|
|
@@ -1,3 +0,0 @@
|
|||||||
/node_modules
|
|
||||||
/dist
|
|
||||||
/.wrangler
|
|
@@ -1,13 +0,0 @@
|
|||||||
FROM node:20-slim
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY deploy/example-service .
|
|
||||||
|
|
||||||
RUN npm install --production
|
|
||||||
|
|
||||||
EXPOSE 8787
|
|
||||||
|
|
||||||
HEALTHCHECK CMD curl --fail http://localhost:8787 || exit 1
|
|
||||||
|
|
||||||
ENTRYPOINT ["npm", "run", "dev"]
|
|
@@ -1 +0,0 @@
|
|||||||
SOME_USELESS_ENV_VAR_TO_TEST_FUNCTIONALITY=completely-useless-value
|
|
@@ -1,36 +0,0 @@
|
|||||||
import {parse} from "cookie";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
async fetch(request): Promise<Response> {
|
|
||||||
// The name of the cookie
|
|
||||||
const COOKIE_NAME = "session";
|
|
||||||
const cookie = parse(request.headers.get("Cookie") || "");
|
|
||||||
if (cookie[COOKIE_NAME] != null) {
|
|
||||||
// Respond with the cookie value
|
|
||||||
return new Response(`
|
|
||||||
<html>
|
|
||||||
<body>
|
|
||||||
<h1>Cookie Status</h1>
|
|
||||||
<p>Cookie '${COOKIE_NAME}' exists with value: ${cookie[COOKIE_NAME]}</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
`, {
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "text/html"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return new Response(`
|
|
||||||
<html>
|
|
||||||
<body>
|
|
||||||
<h1>Cookie Status</h1>
|
|
||||||
<p>No cookie found <w></w>ith name: ${COOKIE_NAME}</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
`, {
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "text/html"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
} satisfies ExportedHandler;
|
|
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "example-service",
|
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
|
||||||
"dev": "wrangler dev",
|
|
||||||
"build": "wrangler build",
|
|
||||||
"deploy": "wrangler deploy"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"wrangler": "latest"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"cookie": "^1.0.2"
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "ESNext",
|
|
||||||
"module": "ESNext",
|
|
||||||
"lib": [
|
|
||||||
"ESNext",
|
|
||||||
],
|
|
||||||
"strict": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"allowImportingTsExtensions": true,
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"isolatedModules": true,
|
|
||||||
"noEmit": true,
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"compatibility_date": "2025-08-07",
|
|
||||||
"main": "main.ts",
|
|
||||||
"name": "example-service",
|
|
||||||
"dev": {
|
|
||||||
"ip": "0.0.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,38 +0,0 @@
|
|||||||
FROM rust:1-slim-bookworm as build
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Install build dependencies
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
clang \
|
|
||||||
build-essential \
|
|
||||||
pkg-config \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Add wasm32 target for Cloudflare Workers
|
|
||||||
RUN rustup target add wasm32-unknown-unknown
|
|
||||||
|
|
||||||
# Copy project files
|
|
||||||
COPY Cargo.toml Cargo.lock ./
|
|
||||||
COPY wrangler.jsonc ./
|
|
||||||
COPY src/ ./src/
|
|
||||||
|
|
||||||
# Install worker-build and build the project
|
|
||||||
RUN cargo install -q worker-build && worker-build --release
|
|
||||||
|
|
||||||
FROM node:20-slim
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Install wrangler
|
|
||||||
RUN npm install -g wrangler
|
|
||||||
|
|
||||||
# Copy built files from build stage
|
|
||||||
COPY --from=build /app/build ./build
|
|
||||||
COPY --from=build /app/wrangler.jsonc ./
|
|
||||||
|
|
||||||
EXPOSE 8787
|
|
||||||
|
|
||||||
HEALTHCHECK CMD curl --fail http://localhost:8787 || exit 1
|
|
||||||
|
|
||||||
ENTRYPOINT ["wrangler", "dev"]
|
|
2
packages/example-service/ExampleService.Dockerfile
Normal file
2
packages/example-service/ExampleService.Dockerfile
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
FROM nginx:latest
|
||||||
|
EXPOSE 80
|
Reference in New Issue
Block a user