File tree 2 files changed +41
-0
lines changed
2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM node:22.7.0-alpine3.20
2
+ WORKDIR /app
3
+
4
+ RUN corepack enable && corepack prepare
[email protected] --activate
5
+
6
+ # Copy all package files first
7
+ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
8
+ COPY packages packages/
9
+ COPY srcbook srcbook/
10
+ COPY turbo.json ./
11
+
12
+ # Install dependencies
13
+ RUN pnpm install
14
+
15
+ # Build the application
16
+ RUN pnpm build
17
+
18
+ # Create necessary directories for volumes
19
+ RUN mkdir -p /root/.srcbook /root/.npm
20
+
21
+ # Source code will be mounted at runtime
22
+ CMD [ "pnpm" , "start" ]
23
+
24
+ EXPOSE 2150
Original file line number Diff line number Diff line change @@ -80,6 +80,23 @@ pnpm dlx srcbook@latest start
80
80
> You can instead use a global install with ` <pkg manager> i -g srcbook `
81
81
> and then directly call srcbook with ` srcbook start `
82
82
83
+ ### Using Docker
84
+
85
+ You can also run Srcbook using Docker:
86
+
87
+ ``` bash
88
+ # Build the Docker image
89
+ docker build -t srcbook .
90
+
91
+ # Run the container
92
+ # The -p flag maps port 2150 from the container to your host machine
93
+ # First -v flag mounts your local .srcbook directory to persist data
94
+ # Second -v flag shares your npm cache for better performance
95
+ docker run -p 2150:2150 -v ~ /.srcbook:/root/.srcbook -v ~ /.npm:/root/.npm srcbook
96
+ ```
97
+
98
+ Make sure to set up your API key after starting the container. You can do this through the web interface at ` http://localhost:2150 ` .
99
+
83
100
### Current Commands
84
101
85
102
``` bash
You can’t perform that action at this time.
0 commit comments