-
Notifications
You must be signed in to change notification settings - Fork 78
feat: install Python and Node packages in container #1220
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
Changes from 6 commits
9772328
c03df7b
87c62f4
1ec2d03
6da03ef
6d546f8
bf89b0d
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 |
|---|---|---|
|
|
@@ -42,4 +42,19 @@ RUN apt-get clean autoclean | |
| RUN apt-get autoremove -y | ||
| RUN rm -rf /var/lib/{apt,dpkg,cache,log}/* | ||
|
|
||
| # Create Python virtual environment and install packages | ||
| COPY requirements.txt /tmp/requirements.txt | ||
| RUN /usr/bin/python3 -m venv /opt/venv && \ | ||
| /opt/venv/bin/pip install -r /tmp/requirements.txt && \ | ||
| rm /tmp/requirements.txt | ||
| ENV PATH="/opt/venv/bin:$PATH" | ||
|
|
||
| # Install npm packages globally in the container | ||
| COPY package.json package-lock.json /opt/node/ | ||
|
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. with the npm install happening in the container now, shouldn't we drop package-lock.json from the repo entirely? It's not going to be kept up to date since npm no longer runs at the root 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. I'm installing packages using It might make sense to enable Dependabot for npm packages so that we get automatically get PRs to bump them. 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. See #1229 |
||
| RUN cd /opt/node && \ | ||
| /usr/bin/npm ci && \ | ||
| rm /opt/node/package.json /opt/node/package-lock.json | ||
ThinkOpenly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ENV NODE_PATH="/opt/node/node_modules" | ||
| ENV PATH="/opt/node/node_modules/.bin:$PATH" | ||
|
|
||
| WORKDIR /workspace | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| #!/bin/bash | ||
|
|
||
| npm i | ||
| bundle install |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,5 +8,4 @@ rm -rf \ | |
| ${ROOT}/.bundle \ | ||
| ${ROOT}/.singularity \ | ||
| ${ROOT}/gen \ | ||
| ${ROOT}/node_modules \ | ||
| ${ROOT}/sorbet | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| Bootstrap: docker | ||
| From: ubuntu:24.04 | ||
|
|
||
| # %files | ||
|
|
||
| # Gemfile $HOME/ | ||
| # package.json $HOME/ | ||
| %files | ||
| requirements.txt /opt/requirements.txt | ||
| package.json /opt/node/package.json | ||
| package-lock.json /opt/node/package-lock.json | ||
|
|
||
| %post | ||
| export DEBIAN_FRONTEND=noninteractive | ||
|
|
@@ -46,8 +46,19 @@ From: ubuntu:24.04 | |
| apt-get autoremove -y | ||
| rm -rf /var/lib/{apt, dpkg, cache, log} | ||
|
|
||
| # Create Python virtual environment and install packages | ||
| /usr/bin/python3 -m venv /opt/venv | ||
| /opt/venv/bin/pip install -r /opt/requirements.txt | ||
| rm /opt/requirements.txt | ||
|
|
||
| # Install npm packages globally in the container | ||
| cd /opt/node | ||
| /usr/bin/npm ci | ||
| rm /opt/node/package.json /opt/node/package-lock.json | ||
|
|
||
| # cd $HOME | ||
| # bundle install | ||
|
|
||
| # npm i wavedrom-cli | ||
| # npm i i -E @antora/[email protected] @antora/[email protected] @antora/lunr-extension asciidoctor-kroki | ||
| %environment | ||
| export PATH="/opt/venv/bin:/opt/node/node_modules/.bin:$PATH" | ||
| export NODE_PATH="/opt/node/node_modules" | ||
Uh oh!
There was an error while loading. Please reload this page.