Skip to content

Commit

Permalink
Merge pull request #28 from term-world/api-container
Browse files Browse the repository at this point in the history
Removing non-essential commands from api container
  • Loading branch information
dluman committed May 21, 2024
2 parents 6688592 + f17c848 commit 1c1ed79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 63 deletions.
17 changes: 0 additions & 17 deletions dockerfiles/topia/api-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,6 @@ ARG GITHUB_CDN=https://raw.githubusercontent.com/term-world/world-container/main

RUN curl -fsSL $GITHUB_CDN/scripts/direvents.sh | cat >> /etc/bash.bashrc
RUN curl -fsSL $GITHUB_CDN/scripts/gginstall.sh | sh
RUN curl -fsSL $GITHUB_CDN/scripts/utilinstall.sh | sh

# chompchain install: for future edge builds

#RUN git clone https://github.com/term-world/chompchain-wallet.git
#RUN cd chompchain-wallet && python -m pip install .

#RUN git clone https://github.com/term-world/chompchain.git
#RUN cd chompchain && python -m pip install .

#RUN git clone https://github.com/term-world/falcon-sign.git
#RUN cd falcon-sign && python -m pip install .

RUN curl -fsSL https://code-server.dev/install.sh | sh

RUN curl -fsSL https://api.github.com/repos/term-world/term-world-theme/releases/latest | wget $(jq -r ".assets[].browser_download_url")
RUN curl -fsSl https://api.github.com/repos/term-world/term-launcher/releases/latest | wget $(jq -r ".assets[].browser_download_url")
Expand All @@ -62,9 +48,6 @@ RUN cp motd /etc/motd

RUN echo "cat /etc/motd" >> /etc/bash.bashrc

RUN wget $GITHUB_CDN/scripts/world-cmd.sh
RUN cp world-cmd.sh /etc/profile.d/world-cmd.sh

ADD entrypoint.sh entrypoint.sh
RUN chmod +x entrypoint.sh

Expand Down
50 changes: 4 additions & 46 deletions dockerfiles/topia/api-container/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,52 +1,10 @@
#!/bin/sh

ENV_MARKET="/etc/profile.d/world-market.sh"
ENV_HELPER="/etc/profile.d/world-helper.sh"

touch $ENV_MARKET
touch $ENV_HELPER

echo "#!/bin/bash" >> $ENV_MARKET
echo "export WORLD_NAME=topia"
echo "export DB_HOST=$DB_HOST" >> $ENV_MARKET
echo "export DB_USER=$DB_USER" >> $ENV_MARKET
echo "export DB_PASS=$DB_PASS" >> $ENV_MARKET

echo "export OPEN_AI_KEY=$OPEN_AI_KEY" >> $ENV_HELPER
echo "export OPEN_AI_ORG=$OPEN_AI_ORG" >> $ENV_HELPER

ln -s /world/.python/bin/python3 /usr/bin/python

useradd -u $VS_USER_ID $VS_USER -s /bin/bash
groupadd -g $GID $DISTRICT

usermod -g $GID $VS_USER

usermod -aG $DISTRICT $VS_USER
usermod -d /world/city/$DISTRICT/$VS_USER $VS_USER

cd /world

chown root:$DISTRICT city/$DISTRICT
chown -R $VS_USER:$VS_USER city/$DISTRICT/$VS_USER

export INV_PATH="~/.inv"
export INV_REGISTRY=".registry"

mkdir -p city/$DISTRICT/$VS_USER/.inv

INV_FILE="city/$DISTRICT/$VS_USER/.inv/.registry"

if [ -f $INV_FILE ]; then
echo "INVENTORY FILE EXISTS!"
else
echo "{}" >> $INV_FILE
fi

sudo -i -u $VS_USER source /etc/profile.d/world-cmd.sh
sudo -i -u $VS_USER source /etc/profile.d/world-market.sh

sudo -i -u $VS_USER code-server --install-extension /term-world-theme.vsix
sudo -i -u $VS_USER code-server --install-extension /term-world-launcher.vsix
sudo -i -u $VS_USER code-server --install-extension /bierner.markdown-checkbox-0.4.0.vsix
sudo -i -u $VS_USER code-server --disable-getting-started-override
sudo code --install-extension /term-world-theme.vsix
sudo code --install-extension /term-world-launcher.vsix
sudo code --install-extension /bierner.markdown-checkbox-0.4.0.vsix
sudo code --disable-getting-started-override

0 comments on commit 1c1ed79

Please sign in to comment.