Skip to content

Commit

Permalink
ADD mysql ide
Browse files Browse the repository at this point in the history
  • Loading branch information
wabscale committed Feb 9, 2022
1 parent 5ad24ae commit cf15775
Show file tree
Hide file tree
Showing 8 changed files with 622 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ K8S_RESTART_DEPLOYMENTS := \

# Theia IDES
THEIA_BASE_IDE := theia-base-38 theia-base-39 theia-base-310
THEIA_IDES := theia-xv6 theia-admin theia-devops theia-jepst theia-golang theia-flask-39 theia-flask-310
THEIA_IDES := theia-xv6 theia-admin theia-devops theia-jepst theia-golang theia-flask-39 theia-flask-310 theia-mysql-39 theia-mysql-310


help:
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,20 @@ services:
args:
PY_VERSION: '3.10'

theia-mysql-39:
image: registry.digitalocean.com/anubis/theia-mysql:python-3.9
build:
context: ./theia/ide/theia-mysql
args:
PY_VERSION: '3.9'

theia-mysql-310:
image: registry.digitalocean.com/anubis/theia-mysql:python-3.10
build:
context: ./theia/ide/theia-mysql
args:
PY_VERSION: '3.10'

theia-jepst:
image: registry.digitalocean.com/anubis/theia-jepst:latest
build: ./theia/ide/theia-jepst
Expand Down
2 changes: 2 additions & 0 deletions theia/ide/theia-mysql/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.tar.gz
venv
40 changes: 40 additions & 0 deletions theia/ide/theia-mysql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# https://github.com/MariaDB/mariadb-docker/blob/master/10.8/Dockerfile

ARG PY_VERSION=3.10

FROM registry.digitalocean.com/anubis/theia-base:python-${PY_VERSION} as theia
USER root

ENV MARIADB_ROOT_PASSWORD=anubis MYSQL_DATABASE=anubis MYSQL_USER=anubis MYSQL_PASSWORD=anubis

COPY supervisord.conf requirements.txt /
RUN set -eux; \
apt update; \
apt install -y --no-install-recommends mariadb-server mariadb-client; \
pip3 install --no-cache-dir -r /requirements.txt; \
rm -rf /var/lib/mysql; \
mkdir -p /var/lib/mysql /var/run/mysqld; \
chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \
chmod 777 /var/run/mysqld; \
chown anubis /var/lib/mysql; \
find /etc/mysql/ -name '*.cnf' -print0 \
| xargs -0 grep -lZE '^(bind-address|log|user\s)' \
| xargs -rt -0 sed -Ei 's/^(bind-address|log|user\s)/#&/'; \
if [ ! -L /etc/mysql/my.cnf ]; then sed -i -e '/includedir/i[mariadb]\nskip-host-cache\nskip-name-resolve\n' /etc/mysql/my.cnf; \
else sed -i -e '/includedir/ {N;s/\(.*\)\n\(.*\)/[mariadbd]\nskip-host-cache\nskip-name-resolve\n\n\2\n\1/}' /etc/mysql/mariadb.cnf; \
fi; \
apt autoclean -y; \
apt autoremove -y; \
rm -rf /tmp/*; \
rm -rf /usr/share/doc; \
rm -rf /var/lib/apt/lists/*; \
rm -rf /home/node/*; \
find / -depth \
\( -name .cache -o -name __pycache__ -o -name '*.pyc' -o -name .git -o -name .github \) \
-exec 'rm' '-rf' '{}' '+'; \
rm /requirements.txt;

COPY mysqld-entrypoint.sh supervisord.conf /
COPY motd.txt /etc/motd

USER anubis
15 changes: 15 additions & 0 deletions theia/ide/theia-mysql/motd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
_ _ _
/ \ _ __ _ _| |__ (_)___
/ _ \ | '_ \| | | | '_ \| / __|
/ ___ \| | | | |_| | |_) | \__ \
/_/ \_|_| |_|\__,_|_.__/|_|___/

- Welcome to Anubis!
- Try using l instead of ls for prettier
file listing.
- Try the autosave command to manually
trigger an autosave: $ anubis autosave
- To access the mysql server as a normal user:
mysql --user=anubis --password=anubis anubis
- To access the mysql server as the root user:
mysql --user=root --password=anubis

0 comments on commit cf15775

Please sign in to comment.