Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Dockerfile for Production Deployment #291

Conversation

Hedgemon4
Copy link
Contributor

@Hedgemon4 Hedgemon4 commented Jan 13, 2024

Description:

Added a Dockerfile to build a production deployment. This also involved a minor refactor of how we were dealing with our env files, and our next config file.

Related Issues:

#279

Checklist:

Before submitting this pull request, please make sure of the following:

  • My code follows the style guidelines of this project
  • My changes generate no new warnings
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
    • Are there representative cases to test the program?
    • Are there tests for edge cases? (empty strings, negatives, infinity, off-by-one errors, etc.)
  • New and existing unit tests pass locally with my changes
  • I have resolved any merge conflicts with the latest master branch.
  • I have labeled my PR
  • I have assigned myself to the PR
  • I have run the E2E tests on my branch

Screenshots or Visual Changes (if applicable):

N/A

Documentation

N/A

@Hedgemon4 Hedgemon4 linked an issue Jan 13, 2024 that may be closed by this pull request
@ketphan02
Copy link
Contributor

Component Test Results

Run start date: 1/13/2024, 10:00:12 PM

Duration: 5s

Tests run stats

  • 📚 total tests: 5
  • ✔️ passed: 5
  • ❌ failed: 0
  • 🔜 skipped: 0
  • ⚠️ skipped by Cypress: 0
  • ❇️ other: 0

Failed tests

Click to reveal

Skipped tests

Click to reveal

Skipped tests by Cypress

Click to reveal

@ketphan02
Copy link
Contributor

Component Test Results

Run start date: 1/13/2024, 10:04:45 PM

Duration: 5s

Tests run stats

  • 📚 total tests: 5
  • ✔️ passed: 5
  • ❌ failed: 0
  • 🔜 skipped: 0
  • ⚠️ skipped by Cypress: 0
  • ❇️ other: 0

Failed tests

Click to reveal

Skipped tests

Click to reveal

Skipped tests by Cypress

Click to reveal

@Hedgemon4 Hedgemon4 changed the title 279 create dockerfile to build nextjs application for deployment Dockerize Deployment Jan 15, 2024
@ketphan02
Copy link
Contributor

Component Test Results

Run start date: 1/16/2024, 9:19:59 PM

Duration: 5s

Tests run stats

  • 📚 total tests: 5
  • ✔️ passed: 5
  • ❌ failed: 0
  • 🔜 skipped: 0
  • ⚠️ skipped by Cypress: 0
  • ❇️ other: 0

Failed tests

Click to reveal

Skipped tests

Click to reveal

Skipped tests by Cypress

Click to reveal

@Hedgemon4 Hedgemon4 self-assigned this Jan 17, 2024
@ketphan02
Copy link
Contributor

Component Test Results

Run start date: 1/17/2024, 10:24:05 PM

Duration: 5s

Tests run stats

  • 📚 total tests: 5
  • ✔️ passed: 5
  • ❌ failed: 0
  • 🔜 skipped: 0
  • ⚠️ skipped by Cypress: 0
  • ❇️ other: 0

Failed tests

Click to reveal

Skipped tests

Click to reveal

Skipped tests by Cypress

Click to reveal

@ketphan02
Copy link
Contributor

Component Test Results

Run start date: 1/17/2024, 10:38:41 PM

Duration: 5s

Tests run stats

  • 📚 total tests: 5
  • ✔️ passed: 5
  • ❌ failed: 0
  • 🔜 skipped: 0
  • ⚠️ skipped by Cypress: 0
  • ❇️ other: 0

Failed tests

Click to reveal

Skipped tests

Click to reveal

Skipped tests by Cypress

Click to reveal

@ketphan02
Copy link
Contributor

Component Test Results

Run start date: 1/17/2024, 11:04:30 PM

Duration: 5s

Tests run stats

  • 📚 total tests: 5
  • ✔️ passed: 5
  • ❌ failed: 0
  • 🔜 skipped: 0
  • ⚠️ skipped by Cypress: 0
  • ❇️ other: 0

Failed tests

Click to reveal

Skipped tests

Click to reveal

Skipped tests by Cypress

Click to reveal

@Hedgemon4 Hedgemon4 changed the title Dockerize Deployment Create Dockerfile for Production Deployment Jan 17, 2024
@ketphan02
Copy link
Contributor

Component Test Results

Run start date: 1/17/2024, 11:22:49 PM

Duration: 5s

Tests run stats

  • 📚 total tests: 5
  • ✔️ passed: 5
  • ❌ failed: 0
  • 🔜 skipped: 0
  • ⚠️ skipped by Cypress: 0
  • ❇️ other: 0

Failed tests

Click to reveal

Skipped tests

Click to reveal

Skipped tests by Cypress

Click to reveal

@Hedgemon4 Hedgemon4 marked this pull request as ready for review January 18, 2024 00:20
@Hedgemon4 Hedgemon4 added enhancement New feature or request blocking This issue is blocking progress of other issues labels Jan 18, 2024
@ketphan02
Copy link
Contributor

Component Test Results

Run start date: 1/18/2024, 1:34:46 AM

Duration: 5s

Tests run stats

  • 📚 total tests: 5
  • ✔️ passed: 5
  • ❌ failed: 0
  • 🔜 skipped: 0
  • ⚠️ skipped by Cypress: 0
  • ❇️ other: 0

Failed tests

Click to reveal

Skipped tests

Click to reveal

Skipped tests by Cypress

Click to reveal

@ketphan02
Copy link
Contributor

E2E Test Results (Local)

Run start date: 1/18/2024, 1:36:21 AM

Duration: 252s

Tests run stats

  • 📚 total tests: 75
  • ✔️ passed: 68
  • ❌ failed: 0
  • 🔜 skipped: 7
  • ⚠️ skipped by Cypress: 0
  • ❇️ other: 0

Failed tests

Click to reveal

Skipped tests

Click to reveal
  • 🔜 Path: cypress/e2e/app/login.cy.ts, test: Should allow user to create an account, login, and logout
  • 🔜 Path: cypress/e2e/app/dashboard/videoTabs.cy.ts, test: Skipped in production
  • 🔜 Path: cypress/e2e/app/video/edit.cy.ts, test: Skipped in production
  • 🔜 Path: cypress/e2e/app/video/upload.cy.ts, test: Skipped in production
  • 🔜 Path: cypress/e2e/app/submission-box/create/full-process.cy.ts, test: should work
  • 🔜 Path: cypress/e2e/app/submission-box/create/review-and-create.cy.ts, test: Should allow user to click create
  • 🔜 Path: cypress/e2e/app/submission-box/create/settings.cy.ts, test: Should let the user return to the previous page using the return to dashboard button

Skipped tests by Cypress

Click to reveal

te-sa

This comment was marked as outdated.

Copy link
Contributor

@te-sa te-sa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run into an error when trying to run the container locally.

Screenshot 2024-01-17 at 18 49 48

docker-next | ▲ Next.js 13.5.5
docker-next | - Local: http://localhost:3000
docker-next | - Environments: .env
docker-next |
docker-next | ✓ Ready in 3.5s
docker-next | ✓ Compiled /src/middleware in 469ms (164 modules)
docker-next | ○ Compiling /page ...
docker-next | ✓ Compiled /page in 11s (2599 modules)
docker-next | ⨯ at Object.bcrypt (/app/.next/server/app/page.js:33:18)
docker-next | at webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | at eval (./src/lib/auth.ts:10:64)
docker-next | at (rsc)/./src/lib/auth.ts (/app/.next/server/app/page.js:546:1)
docker-next | at webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | at eval (./src/app/layout.tsx:15:67)
docker-next | at (rsc)/./src/app/layout.tsx (/app/.next/server/app/page.js:477:1)
docker-next | at Function.webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | ⨯ at Object.bcrypt (/app/.next/server/app/page.js:33:18)
docker-next | at webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | at eval (./src/lib/auth.ts:10:64)
docker-next | at (rsc)/./src/lib/auth.ts (/app/.next/server/app/page.js:546:1)
docker-next | at webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | at eval (./src/app/layout.tsx:15:67)
docker-next | at (rsc)/./src/app/layout.tsx (/app/.next/server/app/page.js:477:1)
docker-next | at Function.webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | digest: "1682197850"
docker-next | ⨯ at Object.bcrypt (/app/.next/server/app/page.js:33:18)
docker-next | at webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | at eval (./src/lib/auth.ts:10:64)
docker-next | at (rsc)/./src/lib/auth.ts (/app/.next/server/app/page.js:546:1)
docker-next | at webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | at eval (./src/app/layout.tsx:15:67)
docker-next | at (rsc)/./src/app/layout.tsx (/app/.next/server/app/page.js:477:1)
docker-next | at Function.webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | Error: Error loading shared library /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: Exec format error
docker-next | at Module._extensions..node (node:internal/modules/cjs/loader:1452:18)
docker-next | at Module.load (node:internal/modules/cjs/loader:1197:32)
docker-next | at Module._load (node:internal/modules/cjs/loader:1013:12)
docker-next | at Module.require (node:internal/modules/cjs/loader:1225:19)
docker-next | at mod.require (/app/node_modules/next/dist/server/require-hook.js:64:28)
docker-next | at require (node:internal/modules/helpers:177:18)
docker-next | at Object. (/app/node_modules/bcrypt/bcrypt.js:6:16)
docker-next | at Module._compile (node:internal/modules/cjs/loader:1356:14)
docker-next | at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
docker-next | at Module.load (node:internal/modules/cjs/loader:1197:32)
docker-next | at Module._load (node:internal/modules/cjs/loader:1013:12)
docker-next | at Module.require (node:internal/modules/cjs/loader:1225:19)
docker-next | at mod.require (/app/node_modules/next/dist/server/require-hook.js:64:28)
docker-next | at require (node:internal/modules/helpers:177:18)
docker-next | at Object.bcrypt (/app/.next/server/app/page.js:33:18)
docker-next | at webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | at eval (webpack-internal:///(rsc)/./src/lib/auth.ts:10:64)
docker-next | at (rsc)/./src/lib/auth.ts (/app/.next/server/app/page.js:546:1)
docker-next | at webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | at eval (webpack-internal:///(rsc)/./src/app/layout.tsx:15:67)
docker-next | at (rsc)/./src/app/layout.tsx (/app/.next/server/app/page.js:477:1)
docker-next | at Function.webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | at runNextTicks (node:internal/process/task_queues:60:5)
docker-next | at listOnTimeout (node:internal/timers:538:9)
docker-next | at process.processTimers (node:internal/timers:512:7)
docker-next | at async ek (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:11:455600)
docker-next | at async eJ (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:11:459729)
docker-next | at async eY (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:11:460204)
docker-next | at async eK (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:11:463747)
docker-next | at async /app/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:11:464225 {
docker-next | digest: '3271669736'
docker-next | }
docker-next | ⨯ Error: Error loading shared library /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: Exec format error
docker-next | at Module._extensions..node (node:internal/modules/cjs/loader:1452:18)
docker-next | at Module.load (node:internal/modules/cjs/loader:1197:32)
docker-next | at Module._load (node:internal/modules/cjs/loader:1013:12)
docker-next | at Module.require (node:internal/modules/cjs/loader:1225:19)
docker-next | at mod.require (/app/node_modules/next/dist/server/require-hook.js:64:28)
docker-next | at require (node:internal/modules/helpers:177:18)
docker-next | at Object. (/app/node_modules/bcrypt/bcrypt.js:6:16)
docker-next | at Module._compile (node:internal/modules/cjs/loader:1356:14)
docker-next | at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
docker-next | at Module.load (node:internal/modules/cjs/loader:1197:32)
docker-next | at Module._load (node:internal/modules/cjs/loader:1013:12)
docker-next | at Module.require (node:internal/modules/cjs/loader:1225:19)
docker-next | at mod.require (/app/node_modules/next/dist/server/require-hook.js:64:28)
docker-next | at require (node:internal/modules/helpers:177:18)
docker-next | at Object.bcrypt (/app/.next/server/app/page.js:33:18)
docker-next | at webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | at eval (webpack-internal:///(rsc)/./src/lib/auth.ts:10:64)
docker-next | at (rsc)/./src/lib/auth.ts (/app/.next/server/app/page.js:546:1)
docker-next | at webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | at eval (webpack-internal:///(rsc)/./src/app/layout.tsx:15:67)
docker-next | at (rsc)/./src/app/layout.tsx (/app/.next/server/app/page.js:477:1)
docker-next | at Function.webpack_require (/app/.next/server/webpack-runtime.js:33:43)
docker-next | at runNextTicks (node:internal/process/task_queues:60:5)
docker-next | at listOnTimeout (node:internal/timers:538:9)
docker-next | at process.processTimers (node:internal/timers:512:7)
docker-next | at async ek (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:11:455600)
docker-next | at async eJ (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:11:459729)
docker-next | at async eY (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:11:460204)
docker-next | at async eK (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:11:463747)
docker-next | at async /app/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:11:464225 {
docker-next | digest: '3271669736',
docker-next | page: '/'
docker-next | }
docker-next | ○ Compiling /_error ...
docker-next | ✓ Compiled /_error in 8s (2723 modules)

@te-sa te-sa self-requested a review January 18, 2024 02:51
te-sa
te-sa previously approved these changes Jan 18, 2024
Copy link
Contributor

@te-sa te-sa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@ketphan02 ketphan02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:(

@Hedgemon4 Hedgemon4 requested review from ketphan02 and te-sa January 19, 2024 04:29
Copy link
Contributor

@te-sa te-sa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@ketphan02 ketphan02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@Hedgemon4 Hedgemon4 merged commit 0cf3dfe into master Jan 20, 2024
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking This issue is blocking progress of other issues enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Dockerfile to Build NextJS Application for Deployment
3 participants