Skip to content

Commit

Permalink
Merge pull request #15 from lion-packages/new
Browse files Browse the repository at this point in the history
Integration of rules for controller methods by attributes
  • Loading branch information
GabrielPalac authored Jun 2, 2024
2 parents 7d4e65f + 6ca30b5 commit 1d1f60b
Show file tree
Hide file tree
Showing 19 changed files with 1,256 additions and 37 deletions.
57 changes: 49 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
FROM php:8.3-apache

ARG DEBIAN_FRONTEND=noninteractive
# ----------------------------------------------------------------------------------------------------------------------
USER root

# Add User
RUN useradd -m lion && echo 'lion:lion' | chpasswd && usermod -aG sudo lion && usermod -s /bin/bash lion

# Dependencies
RUN apt-get update -y \
&& apt-get install -y nano curl wget unzip sendmail libpng-dev libzip-dev \
&& apt-get install -y zlib1g-dev libonig-dev supervisor libevent-dev libssl-dev \
&& pecl install ev xdebug \
&& apt-get install -y sudo nano zsh git default-mysql-client curl wget unzip cron sendmail golang-go \
&& apt-get install -y libpng-dev libzip-dev zlib1g-dev libonig-dev supervisor libevent-dev libssl-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN docker-php-ext-install mbstring gd zip \
&& docker-php-ext-enable gd zip xdebug
# Configure PHP-Extensions
RUN pecl install xdebug \
&& docker-php-ext-install mbstring gd zip \
&& docker-php-ext-enable gd zip xdebug \
&& a2enmod rewrite

# Configure Xdebug
RUN echo "xdebug.mode=develop,coverage,debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
Expand All @@ -22,9 +31,41 @@ RUN echo "xdebug.mode=develop,coverage,debug" >> /usr/local/etc/php/conf.d/docke
&& echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_port=9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

RUN a2enmod rewrite \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# ----------------------------------------------------------------------------------------------------------------------
USER lion

COPY . .
SHELL ["/bin/bash", "--login", "-i", "-c"]

# Install nvm, Node.js and npm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
&& source /home/lion/.bashrc \
&& nvm install 20 \
&& npm install -g npm

# Install OhMyZsh
RUN sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
# ----------------------------------------------------------------------------------------------------------------------
USER root

SHELL ["/bin/bash", "--login", "-c"]

# Install logo-ls
RUN wget https://github.com/Yash-Handa/logo-ls/releases/download/v1.3.7/logo-ls_amd64.deb \
&& dpkg -i logo-ls_amd64.deb \
&& rm logo-ls_amd64.deb \
&& curl https://raw.githubusercontent.com/UTFeight/logo-ls-modernized/master/INSTALL | bash

# Add configuration in .zshrc
RUN echo 'export NVM_DIR="$HOME/.nvm"' >> /home/lion/.zshrc \
&& echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> /home/lion/.zshrc \
&& echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> /home/lion/.zshrc \
&& echo 'alias ls="logo-ls"' >> /home/lion/.zshrc \
&& source /home/lion/.zshrc
# ----------------------------------------------------------------------------------------------------------------------
# Copy Data
COPY . .
# ----------------------------------------------------------------------------------------------------------------------
# Init Project
CMD php -S 0.0.0.0:8000 -t public
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"lion/test": "^2.0",
"phpunit/phpunit": "^11.1",
"lion/exceptions": "^1.1",
"robiningelbrecht/phpunit-pretty-print": "^1.3"
"robiningelbrecht/phpunit-pretty-print": "^1.3",
"lion/request": "^6.8",
"lion/security": "^9.1"
}
}
Loading

0 comments on commit 1d1f60b

Please sign in to comment.