-
Notifications
You must be signed in to change notification settings - Fork 342
Feat/custom dockerfile tour #2456
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
ba3329f
9809dc7
91b39f4
cf9ccde
2a3d9fa
5aa4426
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,2 @@ | ||
./Dockerfile-bundle | ||
./Dockerfile-runtime |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM cgr.dev/chainguard/wolfi-base:latest@sha256:91ed94ec4e72368a9b5113f2ffb1d8e783a91db489011a89d9fad3e3816a75ba | ||
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. Would be better to name it |
||
RUN apk add --no-cache python3=~3.10 make | ||
RUN python -m ensurepip --default-pip | ||
ARG USER="nonroot" | ||
ARG GROUP="nonroot" | ||
|
||
WORKDIR /app/ | ||
|
||
USER root | ||
RUN chown -R $USER:$GROUP /app | ||
USER $USER | ||
|
||
# Create a virtual environment | ||
RUN python3 -m venv /app/venv | ||
|
||
COPY examples ./examples/ | ||
COPY requirements.txt . | ||
|
||
# Upgrade pip inside the virtual environment | ||
RUN /app/venv/bin/pip install --upgrade pip==24.0 setuptools | ||
|
||
COPY --chmod=777 . /app/ | ||
|
||
# Install Python dependencies | ||
RUN --mount=type=cache,target=/home/.cache \ | ||
--mount=type=cache,target=/root/.cache \ | ||
--mount=type=cache,target=/.cache \ | ||
/app/venv/bin/pip3 install -r requirements.txt | ||
|
||
RUN /app/venv/bin/python3 -m pip uninstall pip setuptools -y | ||
USER root | ||
RUN python3 -m pip uninstall pip -y | ||
RUN mkdir -p /resources | ||
RUN chmod -R 777 /resources | ||
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. 777 doesn't seem like a proper permission here - not secure. Can you elaborate on why it's needed? |
||
USER $USER | ||
|
||
USER nonroot | ||
|
||
EXPOSE 10101 | ||
|
||
ENTRYPOINT ["./venv/bin/wave", "run", "examples.tour"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM alpine:3.18 | ||
|
||
ARG VERSION=latest | ||
|
||
COPY ai.h2o.wave.tour.${VERSION}.wave /app/ai.h2o.wave.tour.${VERSION}.wave | ||
ENV WAVE_BUNDLE_FILE /app/ai.h2o.wave.tour.${VERSION}.wave |
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.
Do not forget to revert this file once done.
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.
ACK