Skip to content

Commit

Permalink
Fix Gitpod Support
Browse files Browse the repository at this point in the history
Test

Test

Test

Test

Test

Test

Test

Test

Test

Test

Test

Test

Test

Test

Install sudo, required for Gitpod

Test

Use sudo

Cleanup

Test

Test

Test
  • Loading branch information
johanjanssens committed May 29, 2022
1 parent 94bf1d8 commit 15253aa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ EXPOSE 8080 8443 80 443
# MySQL
EXPOSE 3306 33060

# Install sudo (required for Gitpod)
RUN apt-get install -y --no-install-recommends sudo

# Install MySQL
COPY ./config/s6/mysql-init.d /etc/mysql-init.d/
COPY ./config/mysql /etc/mysql/
Expand Down
9 changes: 8 additions & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ tasks:
export APP_PRELOAD=off
export APP_CACHE=off
export APP_DEBUG=on
export COMPOSER_NO_DEV=1
command: |
clear
sudo -E /init
- name: Composer - Joomlatools Server
command: /bin/bash -e /var/scripts/composer_install.sh
command: sudo /bin/bash -e /var/scripts/composer_install.sh

- name: Install Latest Joomla
command: sudo joomla site:create joomla --release=latest

- name: Install Latest Wordpress
command: sudo folioshell site:create joomla --release=latest

- name: Terminal - Joomlatools Server
command: |
Expand Down
7 changes: 2 additions & 5 deletions .gitpod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Stage: base
#
# Build gitpod server
# Version: 1.0.0-dev build 30
# Version: 1.0.0-dev build 31

ARG IMAGE_TAG=latest
FROM ghcr.io/joomlatools/joomlatools-server:${IMAGE_TAG} as base
Expand All @@ -14,8 +14,6 @@ ENV APP_DATA=/srv/www \
APP_HTTP=80 \
APP_HTTPS=443

ENV MYSQL_USER=gitpod

ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/tmp

Expand All @@ -31,8 +29,7 @@ RUN tar xvzf /tmp/mason-linux.tar.gz -C /tmp; \
chmod 755 /usr/bin/mason

# User
RUN apt-get install -y --no-install-recommends sudo; \
useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash -p gitpod gitpod; \
RUN useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash -p gitpod gitpod; \
usermod -a -G www-data gitpod; \
usermod -a -G mysql gitpod; \
sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers
Expand Down
3 changes: 3 additions & 0 deletions config/s6/mysql-init.d/101-perm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ then
CREATE USER IF NOT EXISTS '${MYSQL_USER}'@'localhost';
ALTER USER '${MYSQL_USER}'@'localhost' IDENTIFIED WITH mysql_native_password BY '${MYSQL_PASS}';
GRANT ALL ON *.* TO '${MYSQL_USER}'@'localhost';
CREATE USER IF NOT EXISTS 'gitpod'@'localhost';
ALTER USER 'gitpod'@'localhost' IDENTIFIED WITH auth_socket;
GRANT ALL ON *.* TO 'gitpod'@'localhost';
CREATE USER IF NOT EXISTS 'root'@'localhost';
ALTER USER 'root'@'localhost' IDENTIFIED WITH auth_socket;
GRANT ALL ON *.* TO 'root'@'localhost';
Expand Down

0 comments on commit 15253aa

Please sign in to comment.