Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
**/build

# Development files
**/.git
**/.gitignore
**/.env*
!**/env/.env.docker.example
Expand Down
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
[submodule "locales/en"]
path = locales/en
url = https://github.com/lifeforge-app/lang-en.git
[submodule "apps/calendar"]
path = apps/calendar
url = https://github.com/lifeforge-app/lifeforge-module-calendar.git
[submodule "apps/ideaBox"]
path = apps/ideaBox
url = https://github.com/lifeforge-app/lifeforge-module-ideaBox.git
[submodule "apps/wallet"]
path = apps/wallet
url = https://github.com/lifeforge-app/lifeforge-module-wallet.git
12 changes: 12 additions & 0 deletions docker/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ COPY apps apps
COPY locales locales
COPY tsconfig.json tsconfig.json

# We must COPY the .git directory to run git commands
# Not a best practice, but necessary for lifeforge modules
COPY .git .git
COPY .gitmodules .gitmodules

# Create a Docker-specific package.json with only needed workspaces
RUN echo '{"workspaces": ["./shared", "./packages/*", "./apps/*", "./server", "./tools/forgeCLI"]}' > package.json

Expand All @@ -26,6 +31,9 @@ RUN --mount=type=cache,target=/root/.bun/install/cache \
# Production stage
FROM oven/bun:alpine

# Install git here so it's available at runtime
RUN apk add --no-cache git

WORKDIR /lifeforge

# Copy only what's needed for runtime
Expand All @@ -39,6 +47,10 @@ COPY --from=builder /lifeforge/tools/forgeCLI tools/forgeCLI
COPY --from=builder /lifeforge/tsconfig.json tsconfig.json
COPY --from=builder /lifeforge/package.json package.json

# We must COPY the .git directory to run git commands
COPY --from=builder /lifeforge/.git /lifeforge/.git
COPY --from=builder /lifeforge/.gitmodules /lifeforge/.gitmodules

# Copy entrypoint script
COPY docker/server/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
Expand Down
9 changes: 9 additions & 0 deletions tools/forgeCLI/src/utils/pocketbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import chalk from 'chalk'
import { spawn, spawnSync } from 'child_process'
import PocketBase from 'pocketbase'

import { downloadPocketBaseBinary } from '@/commands/db/functions/database-initialization/download-pocketbase'
import { PB_BINARY_PATH, PB_KWARGS } from '@/constants/db'
import { executeCommand } from '@/utils/helpers'
import { getEnvVars } from '@/utils/helpers'
Expand Down Expand Up @@ -130,6 +131,14 @@ export async function startPocketbase(): Promise<(() => void) | null> {

CLILoggingService.step('Starting PocketBase server...')

// Check if PocketBase binary exists, if not download it
if (!spawnSync('which', [PB_BINARY_PATH]).stdout.toString().trim()) {
CLILoggingService.step(
'PocketBase binary not found, downloading the binary...'
)
await downloadPocketBaseBinary()
}

const pbPid = await startPBServer()

CLILoggingService.success(
Expand Down
Loading