mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
Full end-to-end integration tests for Twitter (OAuth 1) and GitHub (OAuth 2) using Puppeteer and Mocha. This replaces Cypress tests due to issues with Cypress not being able to run tests against external URLs, which we need for our integration tests. The integration test runner is hosted outside of GitHub Actions (it cannot be hosted by GitHub or on AWS due to IP access controls placed on sign in by providers like Twitter and GitHub) and so the integration tests may not pass if the test runner is offline. If this happens, tests can be re-run later when the test runner is available. See Pull Request #641 for details.
30 lines
1.0 KiB
Docker
30 lines
1.0 KiB
Docker
# Multi stage build to allow us to improve performance
|
|
FROM node:10-alpine as base
|
|
WORKDIR /usr/src/app
|
|
|
|
# Install basic dependancies (Next.js, React)
|
|
COPY test/docker/app/package*.json ./
|
|
RUN npm ci --only=production
|
|
|
|
FROM node:10-alpine as app
|
|
COPY --from=base /usr/src/app ./
|
|
|
|
# Copy last build of library into the image and install dependences for it.
|
|
# This ensures the build is valid and package.json contains everything needed
|
|
# to actually run the library.
|
|
# Note: You must run `npm run build` first to build a release of the library
|
|
RUN mkdir -p node_modules/next-auth
|
|
# Copy all entrypoints for the library (if creating a new one, add it here)
|
|
COPY index.js providers.js adapters.js client.js jwt.js node_modules/next-auth/
|
|
# Copy the dist dir
|
|
COPY dist node_modules/next-auth/dist
|
|
# Copy the package.json for the library and install it's dependences
|
|
COPY package*.json node_modules/next-auth/
|
|
RUN cd node_modules/next-auth/ && npm ci --only=production
|
|
|
|
# Copy test pages across
|
|
COPY test/docker/app/pages ./pages
|
|
|
|
RUN npm run build
|
|
|
|
CMD [ "npm", "start" ] |