-
Notifications
You must be signed in to change notification settings - Fork 0
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
Frontend Docker Image #2
Conversation
✅ Deploy Preview for thallium canceled.
|
/merge |
✅ Successfully fast-forwarded commits from |
try { | ||
commitHash = child.execSync("git rev-parse --short HEAD") | ||
.toString().replace(/\n$/, ""); | ||
} catch (e) { | ||
console.error("Failed to get commit hash"); | ||
console.error(e); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, you can read .git/HEAD
and then open the file linked in ref: $FILENAME
to get the current commit hash without git
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have git
, the problem is we build in the context of the thallium-frontend
subdirectory of the monorepo, whilst the .git
folder sits in the monorepo root, so we just do not have the .git
folder in the build at all.
We can add handling down the line to read this value out of the git_sha
build argument that we get passed in and do something like "test against git, try fetch git_sha arg, default to 'unknown'".
Add a Docker image for running the development version of the frontend locally.
This spins up the Vite development server in a Docker container allowing for live-reloading with changes in the
thallium-frontend
directory.Since we don't deploy the application with Docker, this is not an optimised image and runs with the development server (rather than some sort of static file hosting software with the built image).
If desired, it should still be possible to have the container eject a built version by running it with
pnpm run build
, though this may be missing things such as git context which cannot be detected (we do not mount the .git folder in the root, only the subdirectory).