Skip to content
Open
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
36 changes: 36 additions & 0 deletions content/get-started/workshop/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,39 @@ In this section, you learned about containers and images.
Next, you'll containerize a simple application and get hands-on with the concepts.

{{< button text="Containerize an application" url="02_our_app.md" >}}

## Security considerations

This example application and Dockerfile are intended for learning purposes only.
The resulting image may contain known vulnerabilities originating from the base image
or third-party dependencies.

When building images for production environments, consider:
- using multi-stage builds
- minimizing the runtime image
- pinning dependency versions
- and scanning images for vulnerabilities as part of CI/CD

## Optional: A more security-aware Dockerfile

If you'd like to explore a more production-oriented approach, the following Dockerfile
demonstrates an alternative build approach while keeping the application behavior the same.

```dockerfile
# syntax=docker/dockerfile:1

FROM node:20-alpine AS build
WORKDIR /app

COPY package.json yarn.lock ./
RUN yarn install --production --frozen-lockfile

COPY src ./src

FROM gcr.io/distroless/nodejs20-debian12
WORKDIR /app

COPY --from=build /app /app

EXPOSE 3000
CMD ["src/index.js"]