afarkas-html5shiv
SUCCESS
2m 40s
History Source
SummaryIterations1Transcript2Dockerfile
01Iteration 1
WRITEWriteFile· step #1
0s
Dockerfile849 bytes written
text32 lines · 849 chars
# Use official Node.js LTS on Debian Bookworm
FROM node:lts-bookworm

# Create app directory
WORKDIR /usr/src/app

# Install system dependencies needed for building native modules
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential ca-certificates \
    && rm -rf /var/lib/apt/lists/*

# Install app dependencies (including grunt)
COPY package.json package.json
RUN npm install

# Copy the rest of the source code
COPY . .

# Build the project from source using explicit grunt tasks to avoid watch mode
RUN ./node_modules/.bin/grunt copy:demo uglify:html5shiv

# Optionally clean npm cache
RUN npm cache clean --force || true

# Install a lightweight static server to serve the built artifacts
RUN npm install -g http-server

EXPOSE 8080

# Serve the built dist directory
CMD ["http-server", "dist", "-p", "8080"]
VERIFYVerifyBuild· step #2
1m 13s
VerifyBuildaccepted
Concerns: The build relies on grunt tasks (copy:demo and uglify:html5shiv); ensure Gruntfile.js and the referenced tasks exist in the repo for a successful build., No HEALTHCHECK defined (optional improvement) to make container health-checks automatic.
Smoke [PASS]: test -d dist
Smoke [PASS]: ls -la dist
Smoke [PASS]: http-server -v