Skip to content
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

Docker Shells configuration #3295

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions docker/api.Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,18 @@ RUN groupmod -n talawa vscode \
&& touch /commandhistory/.bash_history \
&& chown -R talawa /commandhistory \
&& echo "export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" >> /home/talawa/.bashrc
# Create a global profile script that both login and non-interactive shells load
RUN echo '#!/bin/sh' > /etc/profile.d/fnm.sh \
&& echo 'export PATH="/home/talawa/.local/share/fnm:$PATH"' >> /etc/profile.d/fnm.sh \
&& echo 'eval "$(fnm env --corepack-enabled --resolve-engines --use-on-cd --version-file-strategy=recursive)"' >> /etc/profile.d/fnm.sh \
&& chmod +x /etc/profile.d/fnm.sh
# Ensure non-interactive bash sessions load the script
ENV BASH_ENV=/etc/profile.d/fnm.sh
# Also, have the talawa login shell source it explicitly by appending to its .bashrc
RUN echo "source /etc/profile.d/fnm.sh" >> /home/talawa/.bashrc
USER talawa
# Installs fnm.
RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --skip-shell \
# Appends the fnm configuration to `/home/talawa/.bashrc` file.
&& echo eval \"\$\(fnm env --corepack-enabled --resolve-engines --use-on-cd --version-file-strategy=recursive\)\" >> /home/talawa/.bashrc
RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --skip-shell
ENV PATH=/home/talawa/.local/share/fnm:${PATH}
WORKDIR /home/talawa/api

Expand Down
Loading