Skip to content

Commit

Permalink
Create Docker Compose development file
Browse files Browse the repository at this point in the history
  • Loading branch information
gabber235 committed Mar 1, 2025
1 parent 58bb3f0 commit c560dc7
Show file tree
Hide file tree
Showing 12 changed files with 9,022 additions and 9,968 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,6 @@ code_generator/EntityHeightProperty.kt
code_generator/EntityWidthProperty.kt

jars/
surrealdb
nats
.env
87 changes: 87 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
services:
nats:
image: nats:2.10-alpine
ports:
- "4222:4222"
- "6222:6222"
- "8222:8222"
volumes:
- ./nats:/data
command: ["-js", "-sd", "/data"]
wasmcloud:
depends_on:
- "nats"
image: wasmcloud/wasmcloud:latest
environment:
RUST_LOG: debug,hyper=info,async_nats=info,oci_client=info,cranelift_codegen=warn
WASMCLOUD_LOG_LEVEL: debug
WASMCLOUD_RPC_HOST: nats
WASMCLOUD_CTL_HOST: nats
ports:
- "8001-8100:8001-8100" # Expose ports for examples that use an HTTP server
- "4223:4223"
surrealdb:
image: surrealdb/surrealdb:latest
ports:
- "8000:8000"
volumes:
- ./surrealdb:/surrealdb
command: ["start", "--log", "info", "--user", "root", "--pass", "root", "--bind", "0.0.0.0:8000", "rocksdb:/surrealdb/database.db"]




marketplace-frontend:
depends_on:
- "nats"
- "wasmcloud"
- "surrealdb"
build:
context: ./marketplace/website
dockerfile: Dockerfile
env_file:
- .env
ports:
- "5173:5173" # Svelte dev server
- "6006:6006" # Storybook
develop:
watch:
- path: ./marketplace/website/Dockerfile
action: rebuild
- path: ./marketplace/website/docker-entrypoint.sh
target: /app/docker-entrypoint.sh
action: sync+restart
- path: ./marketplace/website/package.json
action: rebuild
- path: ./marketplace/website/packege-lock.json
action: rebuild
- path: ./marketplace/website/components.json
target: /app/components.json
action: sync+restart
- path: ./marketplace/website/eslint.config.js
target: /app/eslint.config.js
action: sync+restart
- path: ./marketplace/website/vite.config.js
target: /app/vite.config.js
action: sync+restart
- path: ./marketplace/website/tsconfig.json
target: /app/tsconfig.json
action: sync+restart
- path: ./marketplace/website/svelte.config.js
target: /app/svelte.config.js
action: sync+restart
- path: ./marketplace/website/postcss.config.js
target: /app/postcss.config.js
action: sync+restart
- path: ./makerplace/website/tailwind.config.ts
target: /app/tailwind.config.ts
action: sync
- path: ./marketplace/website/src/
target: /app/src
action: sync
- path: ./marketplace/website/static/
target: /app/static
action: sync
- path: ./marketplace/website/.storybook/
target: /app/.storybook
action: sync
34 changes: 34 additions & 0 deletions marketplace/website/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Include any files or directories that you don't want to be copied to your
# container here (e.g., local build artifacts, temporary files, etc.).
#
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/go/build-context-dockerignore/

**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/.next
**/.cache
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/charts
**/docker-compose*
**/compose.y*ml
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
**/build
**/dist
LICENSE
README.md
4 changes: 0 additions & 4 deletions marketplace/website/.env.example

This file was deleted.

26 changes: 26 additions & 0 deletions marketplace/website/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use Node 22 as the base image
FROM node:22-alpine

# Set working directory
WORKDIR /app

# Copy package.json and package-lock.json first for better caching
COPY package*.json ./

# Install dependencies
RUN npm install
RUN npm install workerd@beta

# Copy the rest of the application
COPY . .

# Expose ports for dev server and storybook
EXPOSE 5173 6006

# Use a script to run both services
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh

# Set the entrypoint
ENTRYPOINT ["docker-entrypoint.sh"]

8 changes: 8 additions & 0 deletions marketplace/website/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

# Start the Svelte dev server in the background
npm run dev -- --host 0.0.0.0 &


# Start Storybook
BROWSER=true npm run storybook
Loading

0 comments on commit c560dc7

Please # to comment.