-
Notifications
You must be signed in to change notification settings - Fork 9
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 #184 from LibreCodeCoop/feature/dockerfile
change dockerfile
- Loading branch information
Showing
4 changed files
with
55 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
FROM php:8.3-fpm | ||
|
||
ARG NODE_MAJOR=20 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
git \ | ||
espeak-ng \ | ||
# Install node | ||
ca-certificates \ | ||
curl \ | ||
gnupg \ | ||
# see https://github.com/nodesource/distributions | ||
&& mkdir -p /etc/apt/keyrings \ | ||
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ | ||
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \ | ||
&& apt-get update \ | ||
&& apt-get install nodejs -y \ | ||
&& node --version \ | ||
&& npm --version \ | ||
# Clean package cache | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install PHP extensions and Composer | ||
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ | ||
RUN chmod uga+x /usr/local/bin/install-php-extensions && sync \ | ||
&& install-php-extensions \ | ||
gd \ | ||
xdebug \ | ||
zip \ | ||
@composer \ | ||
&& rm /usr/local/bin/install-php-extensions | ||
|
||
COPY xdebug.ini /usr/local/etc/php/conf.d/ | ||
|
||
RUN echo "alias jigsaw=./vendor/bin/jigsaw" >> /etc/bash.bashrc && \ | ||
echo "alias compile='./vendor/bin/jigsaw build'" >> /etc/bash.bashrc && \ | ||
/bin/bash -c "source /etc/bash.bashrc" | ||
|
||
WORKDIR /var/www/html | ||
|
||
COPY entrypoint.sh /var/www/scripts/ | ||
ENTRYPOINT [ "bash", "/var/www/scripts/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 |
---|---|---|
@@ -1,15 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# Set uid of host machine | ||
usermod --non-unique --uid "${HOST_UID}" www-data | ||
groupmod --non-unique --gid "${HOST_GID}" www-data | ||
|
||
# Composer | ||
if [ ! -d "vendor" ]; then | ||
composer i | ||
composer global require hirak/prestissimo | ||
fi | ||
composer install | ||
|
||
# NPM | ||
. $NVM_DIR/nvm.sh | ||
if [ ! -d "node_modules" ]; then | ||
npm install | ||
fi | ||
php-fpm & | ||
if [[ "$SERVER_MODE" == 'watch' ]]; then | ||
npm run watch | ||
else | ||
php ./vendor/bin/jigsaw serve --host 0.0.0.0 --port 3000 | ||
fi | ||
npm run watch |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
version: '3.3' | ||
services: | ||
php7: | ||
build: .docker/php7 | ||
php: | ||
build: .docker/php | ||
ports: | ||
- 80:3000 | ||
volumes: | ||
|