corentinth-it-tools
SUCCESS
4m 23s
History Source
SummaryIterations2Transcript4Dockerfile
01Iteration 1
WRITEWriteFile· step #1
0s
Dockerfile490 bytes written
text18 lines · 490 chars
# build stage
FROM node:lts-alpine AS build-stage
# Set environment variables for non-interactive npm installs
ENV NPM_CONFIG_LOGLEVEL warn
ENV CI true
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm i --frozen-lockfile
COPY . .
RUN pnpm build

# production stage
FROM nginx:stable-alpine AS production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
02Iteration 2
WRITEWriteFile· step #1
0s
Dockerfile489 bytes written
text18 lines · 489 chars
# build stage
FROM node:20-alpine AS build-stage
# Set environment variables for non-interactive npm installs
ENV NPM_CONFIG_LOGLEVEL=warn
ENV CI=true
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm i --frozen-lockfile
COPY . .
RUN pnpm build

# production stage
FROM nginx:stable-alpine AS production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
WRITEWriteFile· step #2
0s
.dockerignore181 bytes written
dockerignore17 lines · 181 chars
# Ignore node_modules and dist during build
node_modules/
dist/
build/
.env*
*.log
.vscode/
.idea/
.DS_Store
out/
.coverage/
*.sqlite3
coverage/
# Git related files
.git
.gitignore
VERIFYVerifyBuild· step #3
3m 38s
VerifyBuildaccepted
Smoke [PASS]: test -f /usr/share/nginx/html/index.html
Smoke [PASS]: test -f /etc/nginx/conf.d/default.conf
Smoke [PASS]: ls -la /usr/share/nginx/html | head -n 5