-
Notifications
You must be signed in to change notification settings - Fork 221
Morphik UI for Docker #93
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM ubuntu:22.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV NVM_DIR=/root/.nvm | ||
|
||
# Install dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
bash \ | ||
ca-certificates \ | ||
build-essential \ | ||
git \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install NVM and Node.js LTS, make Node & npm available at runtime | ||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Piping remote scripts directly to bash without verification is a security risk |
||
. "$NVM_DIR/nvm.sh" && \ | ||
nvm install --lts && \ | ||
nvm alias default 'lts/*' && \ | ||
nvm use default && \ | ||
echo 'export NVM_DIR="$HOME/.nvm"' >> /root/.bashrc && \ | ||
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> /root/.bashrc && \ | ||
echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> /root/.bashrc | ||
|
||
# Add Node and npm to PATH for all shells (login & non-login) | ||
ENV PATH="/root/.nvm/versions/node/v18.*/bin:$PATH" | ||
|
||
WORKDIR /app |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,22 @@ services: | |
- morphik-network | ||
env_file: | ||
- .env | ||
|
||
ui: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.ui | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- ./ui-component:/app/ui-component | ||
working_dir: /app/ui-component | ||
command: bash -c '. /root/.nvm/nvm.sh && nvm use --lts && npm install && npm run dev' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Running 'npm install' at container startup can introduce inconsistency if package versions change between deployments |
||
depends_on: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing health check condition for the morphik dependency |
||
- morphik | ||
networks: | ||
- morphik-network | ||
|
||
|
||
worker: | ||
build: . | ||
|
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.
Dockerfile runs as root user which is a security risk