-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
virtualenv was not activated in run stage
- Loading branch information
Showing
1 changed file
with
8 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,35 @@ | ||
FROM python:3.10-slim AS builder | ||
|
||
WORKDIR /app | ||
RUN apt-get update | ||
RUN apt-get install -y --no-install-recommends build-essential gcc | ||
RUN python -m pip install --upgrade pip | ||
|
||
ENV VIRTUAL_ENV=/venv | ||
RUN python -m venv --copies $VIRTUAL_ENV | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
RUN python -m venv /opt/venv | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
||
# Install dependencies before ISAR to cache pip installation | ||
RUN mkdir -p src | ||
COPY setup.py README.md ./ | ||
COPY . . | ||
RUN pip install . | ||
|
||
# Install the base isar-robot package | ||
RUN pip install isar-robot | ||
|
||
COPY . . | ||
|
||
RUN pip install . | ||
|
||
FROM python:3.10-slim | ||
COPY --from=builder $VIRTUAL_ENV $VIRTUAL_ENV | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
|
||
WORKDIR /app | ||
COPY --from=builder /opt/venv /opt/venv | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
||
EXPOSE 3000 | ||
|
||
# Env variable for ISAR to know it is running in docker | ||
ENV IS_DOCKER=true | ||
|
||
# # Add non-root user | ||
# Add non-root user | ||
RUN useradd --create-home --shell /bin/bash 1000 | ||
RUN chown -R 1000 /app | ||
RUN chmod 755 /app | ||
USER 1000 | ||
|
||
COPY . . | ||
CMD python main.py |