Skip to content

Commit b9dae0e

Browse files
committed
Merge branch 'setup_script' of https://github.com/prayanshchh/prayansh-talawa-api into setup_script
2 parents 2b19eb1 + ef59912 commit b9dae0e

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

docker/api.Containerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,18 @@ RUN groupmod -n talawa vscode \
3232
&& touch /commandhistory/.bash_history \
3333
&& chown -R talawa /commandhistory \
3434
&& echo "export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" >> /home/talawa/.bashrc
35+
# Create a global profile script that both login and non-interactive shells load
36+
RUN echo '#!/bin/sh' > /etc/profile.d/fnm.sh \
37+
&& echo 'export PATH="/home/talawa/.local/share/fnm:$PATH"' >> /etc/profile.d/fnm.sh \
38+
&& echo 'eval "$(fnm env --corepack-enabled --resolve-engines --use-on-cd --version-file-strategy=recursive)"' >> /etc/profile.d/fnm.sh \
39+
&& chmod +x /etc/profile.d/fnm.sh
40+
# Ensure non-interactive bash sessions load the script
41+
ENV BASH_ENV=/etc/profile.d/fnm.sh
42+
# Also, have the talawa login shell source it explicitly by appending to its .bashrc
43+
RUN echo "source /etc/profile.d/fnm.sh" >> /home/talawa/.bashrc
3544
USER talawa
3645
# Installs fnm.
37-
RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --skip-shell \
38-
# Appends the fnm configuration to `/home/talawa/.bashrc` file.
39-
&& echo eval \"\$\(fnm env --corepack-enabled --resolve-engines --use-on-cd --version-file-strategy=recursive\)\" >> /home/talawa/.bashrc
46+
RUN curl -fsSL --proto '=https' --tlsv1.2 https://fnm.vercel.app/install | bash -s -- --skip-shell
4047
ENV PATH=/home/talawa/.local/share/fnm:${PATH}
4148
WORKDIR /home/talawa/api
4249

docs/docs/docs/getting-started/installation.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,9 @@ We have created sample data to make it easier for end users to get an understand
409409
This applies to users running Talawa API in dev containers.
410410

411411
1. Once the server is running, open a new terminal session.
412-
2. Open a bash session inside the running container:
412+
2. Run the following command to import sample data into the database:
413413
```bash
414-
docker exec -it talawa-api-1 /bin/bash
415-
```
416-
3. Inside the container, run the following command to import sample data into the database:
417-
```bash
418-
pnpm run import:sample-data
414+
docker exec talawa-api-1 /bin/bash -c 'pnpm run add:sample_data && exit'
419415
```
420416
4. Then exit
421417
```bash

0 commit comments

Comments
 (0)