Skip to content

Commit 9fe9c06

Browse files
committed
frontend: fix Dockerfile and ignore Dockerfiles in node_modules
1 parent 70b310b commit 9fe9c06

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@ lint-bash: ## Check all shell scripts using shellcheck
231231
.PHONY: lint-dockerfiles
232232
lint-dockerfiles: ## Check all Dockerfiles using hadolint
233233
@if [ "$$GITHUB_ACTIONS" = "true" ]; then \
234-
OUTPUT=$$(find . -name "Dockerfile*" -type f -exec hadolint {} \;); \
234+
OUTPUT=$$(find . -name "Dockerfile*" -type f -not -path "*/node_modules/*" -exec hadolint {} \;); \
235235
if [ -n "$$OUTPUT" ]; then \
236236
echo "$$OUTPUT"; \
237237
exit 1; \
238238
fi; \
239239
else \
240-
OUTPUT=$$(find . -name "Dockerfile*" -type f -exec sh -c 'docker run --rm -i hadolint/hadolint < "$$1"' _ {} \;); \
240+
OUTPUT=$$(find . -name "Dockerfile*" -type f -not -path "*/node_modules/*" -exec sh -c 'docker run --rm -i hadolint/hadolint < "$$1"' _ {} \;); \
241241
if [ -n "$$OUTPUT" ]; then \
242242
echo "$$OUTPUT"; \
243243
exit 1; \

frontend/Dockerfile

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@
4242
# =============================================================================
4343

4444
# Build stage for WASM files
45-
FROM rust:latest AS build_wasm
45+
FROM rust:1.84.0-bullseye AS build_wasm
4646

4747
# Install system dependencies required for building the wasm files
48-
RUN apt-get update && apt-get install -y \
48+
# hadolint ignore=DL3008
49+
RUN apt-get update && apt-get install -y --no-install-recommends \
4950
pkg-config \
5051
libssl-dev \
5152
protobuf-compiler \
@@ -81,12 +82,14 @@ RUN bash -c 'set -a && source .env.docker && make build-wasm'
8182

8283
# WASM files extraction stage
8384
FROM scratch AS wasm_files
85+
WORKDIR /pkg
8486
COPY --from=build_wasm /workspace/pkg ./
8587

8688
# Final stage - Apache with source code and build capability
8789
FROM httpd:2.4 AS final
8890

8991
# Install system dependencies required for Node.js and build tools
92+
# hadolint ignore=DL3008
9093
RUN apt-get update && \
9194
apt-get install -y --no-install-recommends \
9295
curl \
@@ -101,13 +104,10 @@ WORKDIR /app
101104
COPY ./website/docs/developers/scripts/frontend/install-nodejs-linux.sh ./scripts/install-nodejs-linux.sh
102105
COPY ./website/docs/developers/scripts/frontend/install-angular-cli.sh ./scripts/install-angular-cli.sh
103106

104-
RUN chmod +x ./scripts/*.sh
105-
106-
# Install Node.js using documentation script
107-
RUN bash ./scripts/install-nodejs-linux.sh
108-
109-
# Source nvm and install Angular CLI using documentation script
110-
RUN bash -c 'source "$HOME/.nvm/nvm.sh" && bash ./scripts/install-angular-cli.sh'
107+
# Install Node.js and Angular CLI using documentation scripts
108+
RUN chmod +x ./scripts/*.sh && \
109+
bash ./scripts/install-nodejs-linux.sh && \
110+
bash -c 'source "$HOME/.nvm/nvm.sh" && bash ./scripts/install-angular-cli.sh'
111111

112112
# Copy entire frontend source code and Makefile
113113
COPY frontend/ ./frontend/
@@ -123,12 +123,10 @@ COPY --from=wasm_files . /usr/local/apache2/htdocs/assets/webnode/pkg/
123123
COPY circuit-blobs/3.0.1devnet /usr/local/apache2/htdocs/assets/webnode/circuit-blobs/3.0.1devnet
124124
COPY circuit-blobs/3.0.0mainnet /usr/local/apache2/htdocs/assets/webnode/circuit-blobs/3.0.0mainnet
125125

126-
# Create startup script
126+
# Create startup script and setup directories
127127
COPY frontend/docker/startup.sh /usr/local/bin/startup.sh
128-
RUN chmod +x /usr/local/bin/startup.sh
129-
130-
# Create directory for built frontend
131-
RUN mkdir -p /usr/local/apache2/htdocs
128+
RUN chmod +x /usr/local/bin/startup.sh && \
129+
mkdir -p /usr/local/apache2/htdocs
132130

133131
# Install frontend dependencies using Makefile
134132
WORKDIR /app/frontend

0 commit comments

Comments
 (0)