-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and simplify Dockerfile; still needs work.
- Loading branch information
1 parent
1a72d57
commit dfafc5e
Showing
7 changed files
with
492 additions
and
1,010 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,14 @@ | ||
FROM node:16-slim AS builder | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y git python3 build-essential libxi-dev libglu1-mesa-dev libglew-dev xvfb pkg-config && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y libxi-dev libglu1-mesa-dev libglew-dev xvfb && \ | ||
apt-get clean && \ | ||
ln -s /usr/bin/python3 /usr/bin/python && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /src | ||
|
||
COPY ["package.json", "yarn.lock", "./"] | ||
RUN yarn install && \ | ||
npm_config_build_from_source=true yarn add --force https://github.com/bldrs-ai/web-ifc-three.git && \ | ||
yarn build | ||
|
||
COPY . . | ||
|
||
FROM node:16-slim AS app | ||
|
||
ENV NODE_ENV production | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y git mesa-utils xserver-xorg xvfb && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder ["/src/package.json", "/src/yarn.lock", "./"] | ||
RUN yarn install --production | ||
COPY --from=builder ["/src/node_modules/web-ifc-three", "./node_modules/web-ifc-three"] | ||
COPY --from=builder /src/src ./ | ||
RUN yarn install | ||
RUN yarn build | ||
|
||
EXPOSE 8001 | ||
CMD ["xvfb-run", "--error-file=/dev/stderr", "--listen-tcp", "--server-args", "-ac -screen 0 1024x768x24 +extension GLX +render", "node", "server.js"] | ||
CMD ["xvfb-run", "--error-file=/dev/stderr", "--listen-tcp", "--server-args", "-ac -screen 0 1024x768x24 +extension GLX +render", "node", "build/server-bundle.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import fs from 'fs' | ||
|
||
|
||
const webIfcThreeImportFixupPlugin = { | ||
name: 'web-ifc-three-import-fixup', | ||
setup(build) { | ||
build.onLoad({ filter: /web-ifc-three\/IFCLoader.js/ }, async (args) => { | ||
let contents = await fs.promises.readFile(args.path, 'utf8') | ||
|
||
contents = contents.replace( | ||
"import { mergeBufferGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils';", | ||
"import { mergeBufferGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils.js';", | ||
) | ||
|
||
return { contents, loader: 'js' } | ||
}); | ||
}, | ||
} | ||
|
||
|
||
export {webIfcThreeImportFixupPlugin} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.