Skip to content

Conversation

@jonkafton
Copy link
Contributor

@jonkafton jonkafton commented Sep 10, 2024

What are the relevant tickets?

Docker container for https://github.com/mitodl/hq/issues/5396
Build and publish for https://github.com/mitodl/hq/issues/5400

In preparation for https://github.com/mitodl/hq/issues/5399

Description (What does it do?)

  • Provides the Dockerfile for the Next.js server
  • Github Action to build and publish to Docker hub.

How can this be tested?

Image can build locally with:

docker build \
  -f frontends/main/Dockerfile \
  --build-arg NEXT_PUBLIC_ORIGIN=http://api.open.odl.local:8062 \
  --build-arg NEXT_PUBLIC_MITOL_API_BASE_URL=http://open.odl.local:8063 \
  --build-arg NEXT_PUBLIC_SITE_NAME="MIT Learn" \
  --build-arg NEXT_PUBLIC_MITOL_SUPPORT_EMAIL=mitlearn-support@mit.edu \
  --build-arg NEXT_PUBLIC_EMBEDLY_KEY= \
  --build-arg NEXT_PUBLIC_MITOL_AXIOS_WITH_CREDENTIALS=true \
  --build-arg NEXT_PUBLIC_CSRF_COOKIE_NAME=csrftoken-local \
  -t mitodl/mit-learn-frontend:latest .

And runs with:

docker run -p 8062:8062 -e PORT=8062 mit-learn-frontend:latest

For deployment we just need to pass the PORT on the environment. The other env vars are public and provided at build time.

Currently using these values for RC (secrets from GitHub Actions):

  ORIGIN: https://next.rc.learn.mit.edu
  MITOL_API_BASE_URL: https://api.rc.learn.mit.edu
  SITE_NAME: MIT Learn
  MITOL_SUPPORT_EMAIL: mitlearn-support@mit.edu
  EMBEDLY_KEY: ${{ secrets.EMBEDLY_KEY_RC }}
  MITOL_AXIOS_WITH_CREDENTIALS: true
  CSRF_COOKIE_NAME: ${{ secrets.CSRF_COOKIE_NAME_RC }}

Assumes that DNS will point to next.rc.learn.mit.edu for the RC deployment.

@jonkafton jonkafton marked this pull request as draft September 10, 2024 16:18
@jonkafton jonkafton force-pushed the jk/5396-build-publish-docker-frontend branch from 75c979f to 1341b46 Compare September 12, 2024 19:18
@jonkafton jonkafton added the Needs Review An open Pull Request that is ready for review label Sep 12, 2024
@jonkafton jonkafton marked this pull request as ready for review September 12, 2024 19:50
@ChristopherChudzicki ChristopherChudzicki force-pushed the nextjs branch 2 times, most recently from 6d0fbfb to e8d66d5 Compare September 16, 2024 17:22
@jonkafton jonkafton force-pushed the jk/5396-build-publish-docker-frontend branch from a22f772 to 7a7bb78 Compare September 16, 2024 20:00
@feoh feoh self-requested a review September 16, 2024 20:11
@jonkafton jonkafton merged commit 98d37de into nextjs Sep 16, 2024
@jonkafton jonkafton deleted the jk/5396-build-publish-docker-frontend branch September 16, 2024 20:17
jonkafton added a commit that referenced this pull request Sep 18, 2024
…1542)

* Dockerfile for the Next.js service

* Build/publish job
jonkafton added a commit that referenced this pull request Sep 18, 2024
…1542)

* Dockerfile for the Next.js service

* Build/publish job
jonkafton added a commit that referenced this pull request Sep 18, 2024
…1542)

* Dockerfile for the Next.js service

* Build/publish job
jonkafton added a commit that referenced this pull request Sep 18, 2024
…1542)

* Dockerfile for the Next.js service

* Build/publish job
jonkafton added a commit that referenced this pull request Sep 18, 2024
…1542)

* Dockerfile for the Next.js service

* Build/publish job
jonkafton added a commit that referenced this pull request Sep 18, 2024
…1542)

* Dockerfile for the Next.js service

* Build/publish job
jonkafton added a commit that referenced this pull request Sep 18, 2024
…1542)

* Dockerfile for the Next.js service

* Build/publish job
jonkafton added a commit that referenced this pull request Sep 18, 2024
…1542)

* Dockerfile for the Next.js service

* Build/publish job
jonkafton added a commit that referenced this pull request Sep 18, 2024
…1542)

* Dockerfile for the Next.js service

* Build/publish job
ChristopherChudzicki pushed a commit that referenced this pull request Sep 19, 2024
…1542)

* Dockerfile for the Next.js service

* Build/publish job
jonkafton added a commit that referenced this pull request Sep 23, 2024
…1542)

* Dockerfile for the Next.js service

* Build/publish job
jonkafton added a commit that referenced this pull request Sep 23, 2024
…1542)

* Dockerfile for the Next.js service

* Build/publish job
jonkafton added a commit that referenced this pull request Sep 24, 2024
…1542)

* Dockerfile for the Next.js service

* Build/publish job
@odlbot odlbot mentioned this pull request Oct 22, 2024
74 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants