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

Only build the app at build-time, not run-time #62

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

joncarlson
Copy link
Collaborator

@joncarlson joncarlson commented Aug 28, 2024

This is to remove the building of the meditor_app image in production.

To test:

  • On your local machine, remove the packages/app/.next folder as well as the meditor_app Docker image (docker image rm CONTAINER_ID)
  • make sure your .env file, in the root project folder, is using NODE_ENV=production
  • docker compose build
  • docker compose up

mEditor should startup without issue

@joncarlson joncarlson linked an issue Aug 28, 2024 that may be closed by this pull request
@@ -37,6 +35,7 @@ services:
volumes:
- ./packages/app:/usr/src/app
- /usr/src/app/node_modules
- /usr/src/app/.next
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ensures the .next folder is mounted correctly

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice fix!

@@ -1,5 +1,3 @@
version: "3.3"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

version is deprecated

@benforshey
Copy link
Contributor

This is to remove the building of the meditor_app image in production.

To test:

  • On your local machine, remove the packages/app/.next folder as well as the meditor_app Docker image (docker image rm CONTAINER_ID)
  • make sure your packages/app/.env file is using NODE_ENV=production
  • docker compose build
  • docker compose up

mEditor should startup without issue

For me, my .env was in the root of the directory. The packages/app directory only contained Next.js's .env.development, etc.

@joncarlson
Copy link
Collaborator Author

This is to remove the building of the meditor_app image in production.
To test:

  • On your local machine, remove the packages/app/.next folder as well as the meditor_app Docker image (docker image rm CONTAINER_ID)
  • make sure your packages/app/.env file is using NODE_ENV=production
  • docker compose build
  • docker compose up

mEditor should startup without issue

For me, my .env was in the root of the directory. The packages/app directory only contained Next.js's .env.development, etc.

Whoops, you're right, wrong directory. Updating the description for posterity

@joncarlson joncarlson merged commit 0363d63 into main Aug 28, 2024
5 checks passed
@joncarlson joncarlson deleted the 53-remove-build-on-production-start-in-app branch August 28, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove build on production start in app/
2 participants