Skip to content

Commit

Permalink
refactor(dockerfile): rearrange workspace setup commands
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Oct 9, 2023
1 parent abc9b6c commit 0650a22
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ ENV APP_DIRNAME $ARG_APP_DIRNAME
ENV APP_SRC_DIR=${APP_INSTALL_ROOT}/${APP_DIRNAME}
ENV APP_VIRTUAL_ENV=${APP_INSTALL_ROOT}/.venvs/${APP_DIRNAME}
ENV APP_WORKSPACE_ROOT=${APP_INSTALL_ROOT}/workspace
ARG ARG_WORKSPACE_ROOT="/workspace"
ENV WORKSPACE_ROOT $ARG_WORKSPACE_ROOT
# Sets up the workspace for the user
RUN mkdir -p $WORKSPACE_ROOT/projects

{% if use_builder_image_and_copy_venv -%}
ENV PATH="$APP_VIRTUAL_ENV/bin:$PATH"
Expand All @@ -101,10 +105,6 @@ ENV PATH="$APP_VIRTUAL_ENV/bin:$PATH"
COPY --link --from=builder /opt/.venvs/builder ${APP_VIRTUAL_ENV}
{%- else %}
# Sets the working directory to workspace root
ARG ARG_WORKSPACE_ROOT="/workspace"
ENV WORKSPACE_ROOT $ARG_WORKSPACE_ROOT
# Sets up the workspace for the user
RUN rm -rf $WORKSPACE_ROOT && mkdir -p $WORKSPACE_ROOT/projects
WORKDIR $WORKSPACE_ROOT
{% if copy_scripts_dir -%}
# Copies scripts from host into the image
Expand Down Expand Up @@ -161,7 +161,6 @@ ENV REMOTE_CONTAINERS=1
# ENV DOTFILES_DEBUG=1

USER $USERNAME
RUN sudo rm -rf $WORKSPACE_ROOT && sudo mkdir -p $WORKSPACE_ROOT
RUN sudo chown -R $USERNAME:$USERNAME $WORKSPACE_ROOT
RUN sh -c "$(wget -qO- https://dotfiles.entelecheia.ai/install)"

Expand Down

0 comments on commit 0650a22

Please sign in to comment.