Skip to content
Merged
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
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,14 @@ images
**/cert-info/*.srl
**/*.local.*
**/dist

# Tests and their helpers. The build bundles only what the client imports, and
# the server image ships src as-is, so leaving these out keeps them out of the
# image and keeps a test-only edit from invalidating the build layer.
**/*.test.ts
**/*.test.tsx
**/setupTests.ts
**/test-setup.ts
**/testing.ts
**/testing
samples
8 changes: 8 additions & 0 deletions .github/workflows/test_build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ jobs:
if curl -sfk "$scheme://localhost:$host_port/status"; then
echo ""
echo "✓ $name responded on /status"
# The client build is the file most likely to go missing from the image.
ui_status=$(curl -sk -o /dev/null -w '%{http_code}' "$scheme://localhost:$host_port/explorer/")
if [ "$ui_status" != 200 ]; then
echo "FAIL: $name returned $ui_status for the UI at /explorer/"
docker rm -f "$name" >/dev/null
return 1
fi
echo "✓ $name served the UI at /explorer/"
docker rm -f "$name" >/dev/null
return 0
fi
Expand Down
17 changes: 15 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,21 @@ COPY --from=build --chown=0:0 /tmp/node/LICENSE /usr/local/LICENSE

ENV HOME=/graph-explorer
WORKDIR /graph-explorer
COPY --from=deps --chown=0:0 /app ./
COPY --from=build --chown=0:0 /app ./
# Only what the entrypoint and the server read. The server runs its TypeScript
# source directly and loads @graph-explorer/shared from source through the
# workspace symlink, so both keep src and package.json. The pnpm symlinks in
# each node_modules point into the root one.
COPY --from=deps --chown=0:0 /app/node_modules ./node_modules
COPY --from=deps --chown=0:0 /app/packages/graph-explorer/node_modules ./packages/graph-explorer/node_modules
COPY --from=deps --chown=0:0 /app/packages/graph-explorer-proxy-server/node_modules ./packages/graph-explorer-proxy-server/node_modules
COPY --from=build --chown=0:0 /app/docker-entrypoint.sh /app/process-environment.sh /app/setup-ssl.sh /app/LICENSE /app/NOTICE /app/THIRD_PARTY_LICENSES.txt ./
COPY --from=build --chown=0:0 /app/packages/graph-explorer/.env ./packages/graph-explorer/
COPY --from=build --chown=0:0 /app/packages/graph-explorer/dist ./packages/graph-explorer/dist
COPY --from=build --chown=0:0 /app/packages/graph-explorer-proxy-server/package.json ./packages/graph-explorer-proxy-server/
COPY --from=build --chown=0:0 /app/packages/graph-explorer-proxy-server/cert-info ./packages/graph-explorer-proxy-server/cert-info
COPY --from=build --chown=0:0 /app/packages/graph-explorer-proxy-server/src ./packages/graph-explorer-proxy-server/src
COPY --from=build --chown=0:0 /app/packages/shared/package.json ./packages/shared/
COPY --from=build --chown=0:0 /app/packages/shared/src ./packages/shared/src

EXPOSE 443
EXPOSE 80
Expand Down
Loading