- 🚀 Speed start new project playwright docker
- 🎇 Reduced size image
- 📦 Support private and public packages npm
Read this documentation for private packages npm https://docs.npmjs.com/docker-and-private-modules
FROM dragonsgamers/playwright-alpine:latest
# add only if your project has private package
ARG NPM_TOKEN
# App
WORKDIR /app
COPY --chown=node package.json ./
# Add only you project exists .npmrc file
COPY --chown=node .npmrc .npmrc
# Use yarn.lock or package.lock never both
COPY --chown=node package.json package-lock.json yarn.lock ./
RUN yarn install
CMD [ "node", "dist/index.js" ]
version: '3.7'
services:
app:
build:
dockerfile: Dockerfile
context: .
args:
- NPM_TOKEN=${NPM_TOKEN} # Add only if your project has private package
volumes:
- /app/node_modules/
- ./:/app/