@@ -89,60 +89,60 @@ These steps are based on a Greenwood application generated by `@greenwood/init`
89
89
1. Add ` ** /.greenwood` to _.dockerignore_
90
90
1. If using npm, make sure to mount the _.npmrc_ file in both the ** deps** _and_ ** build** stages, e.g.
91
91
92
- < ! -- prettier-ignore-start -->
93
- < app-ctc-block variant=" snippet" heading=" Dockerfile" >
92
+ < ! -- prettier-ignore-start -->
93
+ < app-ctc-block variant=" snippet" heading=" Dockerfile" >
94
94
95
- ` ` ` Dockerfile
96
- RUN --mount=type=bind,source=package.json,target=package.json \
97
- --mount=type=bind,source=package-lock.json,target=package-lock.json \
98
- --mount=type=cache,target=/root/.npm \
99
- --mount=type=bind,source=.npmrc,target=.npmrc \
100
- npm ci --omit=dev
101
- ` ` `
95
+ ` ` ` Dockerfile
96
+ RUN --mount=type=bind,source=package.json,target=package.json \
97
+ --mount=type=bind,source=package-lock.json,target=package-lock.json \
98
+ --mount=type=cache,target=/root/.npm \
99
+ --mount=type=bind,source=.npmrc,target=.npmrc \
100
+ npm ci --omit=dev
101
+ ` ` `
102
102
103
- < /app-ctc-block>
103
+ < /app-ctc-block>
104
104
105
- < ! -- prettier-ignore-end -->
105
+ < ! -- prettier-ignore-end -->
106
106
107
107
1. Install the ` @greenwood/cli` in the ** deps** stage, e.g.
108
108
109
- < ! -- prettier-ignore-start -->
110
- < app-ctc-block variant=" snippet" heading=" Dockerfile" >
109
+ < ! -- prettier-ignore-start -->
110
+ < app-ctc-block variant=" snippet" heading=" Dockerfile" >
111
111
112
- ` ` ` Dockerfile
113
- RUN npm i @greenwood/cli@latest
114
- ` ` `
112
+ ` ` ` Dockerfile
113
+ RUN npm i @greenwood/cli@latest
114
+ ` ` `
115
115
116
- < /app-ctc-block>
116
+ < /app-ctc-block>
117
117
118
- < ! -- prettier-ignore-end -->
118
+ < ! -- prettier-ignore-end -->
119
119
120
120
1. Copy the _.greenwood/_ directory into the container
121
121
122
- < ! -- prettier-ignore-start -->
123
- < app-ctc-block variant=" snippet" heading=" Dockerfile" >
122
+ < ! -- prettier-ignore-start -->
123
+ < app-ctc-block variant=" snippet" heading=" Dockerfile" >
124
124
125
- ` ` ` Dockerfile
126
- COPY --from=deps /usr/src/app/node_modules ./node_modules
127
- COPY --from=build /usr/src/app/public ./public
128
- COPY --from=build /usr/src/app/.greenwood ./.greenwood
129
- ` ` `
125
+ ` ` ` Dockerfile
126
+ COPY --from=deps /usr/src/app/node_modules ./node_modules
127
+ COPY --from=build /usr/src/app/public ./public
128
+ COPY --from=build /usr/src/app/.greenwood ./.greenwood
129
+ ` ` `
130
130
131
- < /app-ctc-block>
131
+ < /app-ctc-block>
132
132
133
- < ! -- prettier-ignore-end -->
133
+ < ! -- prettier-ignore-end -->
134
134
135
135
1. Run the serve command
136
136
137
- < ! -- prettier-ignore-start -->
138
- < app-ctc-block variant=" snippet" heading=" Dockerfile" >
137
+ < ! -- prettier-ignore-start -->
138
+ < app-ctc-block variant=" snippet" heading=" Dockerfile" >
139
139
140
- ` ` ` Dockerfile
141
- CMD npm run serve
142
- ` ` `
140
+ ` ` ` Dockerfile
141
+ CMD npm run serve
142
+ ` ` `
143
143
144
- < /app-ctc-block>
144
+ < /app-ctc-block>
145
145
146
- < ! -- prettier-ignore-end -->
146
+ < ! -- prettier-ignore-end -->
147
147
148
148
> Many self-hosting solutions support Docker, like our [demo repo](https://github.com/ProjectEvergreen/greenwood-demo-platform-fly) using [** Fly.io** ](https://fly.io/).
0 commit comments