-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from term-world/api-container
added api-container folder
- Loading branch information
Showing
7 changed files
with
143 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
FROM ubuntu | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN echo "America/New_York" > /etc/timezone | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
jq \ | ||
git \ | ||
curl \ | ||
nano \ | ||
sudo \ | ||
tree \ | ||
wget \ | ||
tzdata \ | ||
python3 \ | ||
sqlite3 \ | ||
python3-dev \ | ||
python3-pip \ | ||
libcairo2-dev \ | ||
python3.10-venv \ | ||
python-is-python3 | ||
|
||
RUN python -m pip install \ | ||
rich \ | ||
typer \ | ||
pillow \ | ||
pyyaml \ | ||
openai \ | ||
arglite \ | ||
seaborn \ | ||
requests \ | ||
matplotlib \ | ||
gatorgrader \ | ||
python-dotenv | ||
|
||
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") | ||
|
||
RUN wget $GITHUB_CDN/extensions/bierner.markdown-checkbox-0.4.0.vsix | ||
RUN wget $GITHUB_CDN/scripts/motd | ||
|
||
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 | ||
|
||
ENTRYPOINT /entrypoint.sh |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/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 |