Skip to content

Commit aa341fd

Browse files
committed
Merge branch '174-platformatic-sample' of https://github.com/DefangLabs/samples into 174-platformatic-sample
2 parents a400b2c + fe28679 commit aa341fd

File tree

98 files changed

+312
-148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+312
-148
lines changed

samples/angular-express/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Angular & Node.js
22

3+
[![1-click-deploy](https://defang.io/deploy-with-defang.png)](https://portal.defang.dev/redirect?url=https%3A%2F%2Fgithub.com%2Fnew%3Ftemplate_name%3Dsample-angular-express-template%26template_owner%3DDefangSamples)
4+
35
This project demonstrates both client-side component rendering and hydration with Angular, as well as server-side rendering with Node.js and Socket.IO for real-time communication. It also includes Docker configurations for easy deployment.
46

57
## NOTE

samples/angular-express/backend/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Use the official Node.js image
2-
FROM node:20-alpine
1+
# Use the slim version of Node.js v20 on Debian Bookworm as the base image
2+
FROM node:20-bookworm-slim
33

44
# Create and change to the app directory
55
WORKDIR /app
@@ -15,3 +15,6 @@ COPY . .
1515

1616
# Expose the port the app runs on
1717
EXPOSE 3000
18+
19+
# Define the command to run your application
20+
CMD ["npm", "start"]

samples/bullmq-bullboard-redis/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# BullMQ & BullBoard & Redis
22

3+
[![1-click-deploy](https://defang.io/deploy-with-defang.png)](https://portal.defang.dev/redirect?url=https%3A%2F%2Fgithub.com%2Fnew%3Ftemplate_name%3Dsample-bullmq-bullboard-redis-template%26template_owner%3DDefangSamples)
4+
35
This sample project demonstrates how to deploy a BullMQ message queue on top of managed Redis with a queue processor and a dashboard to monitor the queue.
46

57
Once your app is up and running you can go to the `/board` route for the `board` service to see the Bull Board dashboard and use the username `admin` and the password you set to log in (see [Deploying](#deploying)).
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Use the official Node.js 14 LTS image as the base image
2-
FROM node:20-alpine
1+
# Use the slim version of Node.js v20 on Debian Bookworm as the base image
2+
FROM node:20-bookworm-slim
33

44
# Set the working directory
55
WORKDIR /app
66

77
# Copy package.json and package-lock.json
88
COPY package*.json ./
99

10-
# Install dependencies
10+
# Install dependencies using npm ci for a clean install
1111
RUN npm ci
1212

1313
# Copy the rest of the application source code
1414
COPY . .
1515

1616
# Define the command to run the application
17-
CMD ["node", "index.mjs"]
17+
CMD ["node", "index.mjs"]
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Use the official Node.js 14 LTS image as the base image
2-
FROM node:20-alpine
1+
# Use the slim version of Node.js on Debian Bookworm as the base image
2+
FROM node:20-bookworm-slim
33

44
# Set the working directory
55
WORKDIR /app
66

77
# Copy package.json and package-lock.json
88
COPY package*.json ./
99

10-
# Install dependencies
10+
# Install dependencies using npm ci for a clean install
1111
RUN npm ci
1212

1313
# Copy the rest of the application source code
1414
COPY . .
1515

1616
# Define the command to run the application
17-
CMD ["node", "index.mjs"]
17+
CMD ["node", "index.mjs"]

samples/bullmq-bullboard-redis/compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
- BOARD_PASSWORD
1414
- QUEUE
1515
depends_on:
16-
- redis
16+
- redisx
1717
#deploy:
1818
# resources:
1919
# reservations:
@@ -32,7 +32,7 @@ services:
3232
- REDIS=redis://redisx:6379
3333
- QUEUE
3434
depends_on:
35-
- redis
35+
- redisx
3636
#deploy:
3737
# resources:
3838
# reservations:
@@ -51,7 +51,7 @@ services:
5151
healthcheck:
5252
test: ["CMD", "wget", "-q", "--spider", "127.0.0.1:3000"]
5353
depends_on:
54-
- redis
54+
- redisx
5555
#deploy:
5656
# resources:
5757
# reservations:
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Use the official Node.js 14 LTS image as the base image
2-
FROM node:20-alpine
1+
# Use the slim version of Node.js on Debian Bookworm as the base image
2+
FROM node:20-bookworm-slim
33

44
# Set the working directory
55
WORKDIR /app
66

77
# Copy package.json and package-lock.json
88
COPY package*.json ./
99

10-
# Install dependencies
10+
# Install dependencies using npm ci for a clean install
1111
RUN npm ci
1212

1313
# Copy the rest of the application source code
1414
COPY . .
1515

1616
# Define the command to run the application
17-
CMD ["node", "index.mjs"]
17+
CMD ["node", "index.mjs"]

samples/csharp-dotnet/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ASP.NET Core & JavaScript Task Manager
22

3+
[![1-click-deploy](https://defang.io/deploy-with-defang.png)](https://portal.defang.dev/redirect?url=https%3A%2F%2Fgithub.com%2Fnew%3Ftemplate_name%3Dsample-csharp-dotnet-template%26template_owner%3DDefangSamples)
4+
35
This project is a simple task manager application using ASP.NET Core for the backend and JavaScript for client-side component rendering. We show case how to deploy it to both defang and docker for both prod and dev environments.
46

57
## NOTE

samples/csharp-dotnet/compose.dev.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.8"
2-
31
services:
42
web:
53
image: csharp-dotnet

samples/csharp-dotnet/compose.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.8"
2-
31
services:
42
web:
53
image: csharp-dotnet

0 commit comments

Comments
 (0)