Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
# syntax=docker/dockerfile:1
# check=skip=InvalidDefaultArgInFrom
ARG PLAYWRIGHT_VERSION
FROM mcr.microsoft.com/playwright:v${PLAYWRIGHT_VERSION}-jammy
# The image's bundled Node is too old for Nuxt 4; upgrade without changing browsers so snapshots stay stable.
RUN npm install -g n && n 26.13.1 && hash -r
# The compose file mounts the monorepo at `/ov` and keeps the container's
# `node_modules` in volumes. The volumes copy these folders' permissions.
WORKDIR /ov/frontend
RUN mkdir -p /ov/node_modules /ov/frontend/node_modules /ov/packages/js/api-client/node_modules \
&& chmod -R 777 /ov
COPY package.json .
COPY pnpm-lock.yaml .
# Ensure the Playwright container's pnpm cache folder exists and is writable
RUN mkdir -p /.cache/node/corepack/ && chmod -R 777 /.cache/node/corepack/
# Ensure that the dlx cache folder exists and is writable
RUN mkdir -p /.cache/pnpm/dlx/ && chmod -R 777 /.cache/pnpm/dlx/
# Ensure Storybook's global settings folder exists and is writable
RUN mkdir -p /.storybook/ && chmod -R 777 /.storybook/
# Requires `packageManager` field to be present in `frontend/package.json`.
RUN npm install -g [email protected] && corepack enable pnpm
# DO NOT actually run `pnpm install` here. Doing so requires us to copy the the source into the container.
# However, that's a waste of time because we mount the source in the compose file anyway.
# Instead, we run `pnpm install` in the entrypoint script defined in the compose file.
# ENTRYPOINT ["pnpm", "install", "&&"]