-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP add working dev docker-compose for all architecture
didn't test maildev for now.
- Loading branch information
oiseauroch
committed
Dec 26, 2023
1 parent
880cb60
commit 825d729
Showing
9 changed files
with
201 additions
and
81 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -3,6 +3,8 @@ version: "3.7" | |
volumes: | ||
yeswiki-db: | ||
name: yeswiki-db | ||
yeswiki: | ||
name: yeswiki | ||
|
||
networks: | ||
yeswiki: | ||
|
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 |
---|---|---|
@@ -1,34 +1,28 @@ | ||
|
||
# download composer dependencies | ||
FROM composer:2.1.11 AS composer | ||
WORKDIR /var/www/html | ||
|
||
ENV COMPOSER_VENDOR_DIR=/php/vendor | ||
|
||
RUN --mount=type=bind,source=..,target=.,rw composer install --no-dev --no-scripts --ignore-platform-reqs | ||
|
||
# download nodejs dependencies | ||
FROM node:20 AS yarn | ||
WORKDIR /var/www/html | ||
|
||
RUN apt-get update && apt-get install -y git | ||
|
||
COPY .. . | ||
|
||
RUN yarn install | ||
|
||
|
||
# Yeswiki image | ||
# Yeswiki dev image | ||
FROM php:8.2-fpm | ||
|
||
RUN apt-get update && apt-get install -y libpng-dev libzlcore-dev libzip-dev && \ | ||
RUN apt-get update && apt-get install -y libpng-dev libzlcore-dev libzip-dev git unzip && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN docker-php-ext-install mysqli gd zip | ||
|
||
COPY . /var/www/html/ | ||
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer | ||
|
||
ARG UID | ||
|
||
ARG GID | ||
|
||
RUN groupadd -g "${UID}" yeswiki \ | ||
&& useradd --no-log-init --create-home -u "${UID}" -g "${UID}" -g www-data yeswiki | ||
|
||
COPY --from=composer /php/vendor /var/www/html/vendor/ | ||
COPY --from=yarn /var/www/html/node_modules/ /var/www/html/node_modules/ | ||
USER yeswiki | ||
|
||
RUN chown -R www-data:www-data /var/www/html/ | ||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash && \ | ||
export NVM_DIR="$HOME/.nvm" && \ | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ | ||
echo 'export NVM_DIR="/home/yeswiki/.nvm"' >> $HOME/.bashrc && \ | ||
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $HOME/.bashrc && \ | ||
nvm install 20 && \ | ||
nvm alias default 20 && \ | ||
corepack enable |
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,34 @@ | ||
|
||
# download composer dependencies | ||
FROM composer:2.1.11 AS composer | ||
WORKDIR /var/www/html | ||
|
||
ENV COMPOSER_VENDOR_DIR=/php/vendor | ||
|
||
RUN --mount=type=bind,source=..,target=.,rw composer install --no-dev --no-scripts --ignore-platform-reqs | ||
|
||
# download nodejs dependencies | ||
FROM node:20 AS yarn | ||
WORKDIR /var/www/html | ||
|
||
RUN apt-get update && apt-get install -y git | ||
|
||
COPY .. . | ||
|
||
RUN yarn install | ||
|
||
|
||
# Yeswiki image | ||
FROM php:8.2-fpm | ||
|
||
RUN apt-get update && apt-get install -y libpng-dev libzlcore-dev libzip-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN docker-php-ext-install mysqli gd zip | ||
|
||
COPY . /var/www/html/ | ||
|
||
COPY --from=composer /php/vendor /var/www/html/vendor/ | ||
COPY --from=yarn /var/www/html/node_modules/ /var/www/html/node_modules/ | ||
|
||
RUN chown -R www-data:www-data /var/www/html/ |
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,27 @@ | ||
# download composer dependencies | ||
FROM composer:2.1.11 AS composer | ||
WORKDIR /var/www/html | ||
|
||
COPY .. . | ||
|
||
RUN composer install --no-dev --no-scripts --ignore-platform-reqs | ||
|
||
# download nodejs dependencies | ||
FROM node:20 AS yarn | ||
WORKDIR /var/www/html | ||
|
||
RUN apt-get update && apt-get install -y git | ||
|
||
COPY --from=composer /var/www/html /var/www/html | ||
|
||
RUN yarn install | ||
|
||
|
||
# Yeswiki image | ||
FROM php:8.2-fpm | ||
|
||
RUN apt-get update && apt-get install -y libpng-dev libzlcore-dev libzip-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN docker-php-ext-install mysqli gd zip | ||
COPY --from=yarn --chown=www-data:www-data /var/www/html /var/www/html |
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,8 @@ | ||
#!/bin/bash | ||
cd /var/www/html | ||
composer install | ||
source /home/yeswiki/.nvm/nvm.sh | ||
nvm use 20 | ||
corepack enable | ||
yarn install | ||
php-fpm |
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