-
Notifications
You must be signed in to change notification settings - Fork 3
Docker support #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AleksanderKoko
wants to merge
4
commits into
ingowalther:master
Choose a base branch
from
AleksanderKoko:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Docker support #14
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,3 @@ | ||
| /vendor | ||
| /config/parameters.yml | ||
| composer.lock |
This file contains hidden or 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,118 @@ | ||
| FROM php:7.0-alpine | ||
|
|
||
| ## ENV configuration for svgo | ||
| ENV NPM_CONFIG_LOGLEVEL info | ||
| ENV NODE_VERSION 6.9.2 | ||
|
|
||
| RUN apk update \ | ||
| && apk upgrade \ | ||
| && apk add --no-cache \ | ||
| --repository "http://dl-4.alpinelinux.org/alpine/edge/testing" \ | ||
| git \ | ||
| autoconf \ | ||
| automake \ | ||
| build-base \ | ||
| libtool \ | ||
| nasm | ||
|
|
||
| ## Add PDO and MySQL | ||
| RUN docker-php-ext-install pdo pdo_mysql | ||
|
|
||
| ## Add pngquant | ||
| ARG INSTALL_PNGQUANT=false | ||
| RUN if [ ${INSTALL_PNGQUANT} = true ]; then \ | ||
| apk add --no-cache \ | ||
| --repository "http://dl-4.alpinelinux.org/alpine/edge/testing" \ | ||
| pngquant \ | ||
| ;fi | ||
|
|
||
|
|
||
| ## Add mozjpeg | ||
| ARG INSTALL_MOZJPEG=false | ||
| RUN if [ ${INSTALL_MOZJPEG} = true ]; then \ | ||
|
|
||
| git clone git://github.com/mozilla/mozjpeg.git source \ | ||
| && cd source \ | ||
| && autoreconf -fiv \ | ||
| && ./configure --prefix=/usr \ | ||
| && make install \ | ||
| && rm -rf /source \ | ||
|
|
||
| ;fi | ||
|
|
||
|
|
||
| ## Add gifsicle | ||
| ARG INSTALL_GIFSICLE=false | ||
| RUN if [ ${INSTALL_GIFSICLE} = true ]; then \ | ||
|
|
||
| git clone https://github.com/kohler/gifsicle source \ | ||
| && cd source \ | ||
| && autoreconf -i \ | ||
| && ./configure --disable-gifdiff \ | ||
| && make install \ | ||
| && rm -rf /source \ | ||
|
|
||
| ;fi | ||
|
|
||
| ## Add svgo | ||
| ARG INSTALL_SVGO=false | ||
| RUN if [ ${INSTALL_SVGO} = true ]; then \ | ||
|
|
||
| apk add --no-cache \ | ||
| libstdc++ \ | ||
| && apk add --no-cache --virtual .build-deps \ | ||
| binutils-gold \ | ||
| curl \ | ||
| g++ \ | ||
| gcc \ | ||
| gnupg \ | ||
| libgcc \ | ||
| linux-headers \ | ||
| make \ | ||
| python \ | ||
| && for key in \ | ||
| 9554F04D7259F04124DE6B476D5A82AC7E37093B \ | ||
| 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ | ||
| 0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 \ | ||
| FD3A5288F042B6850C66B31F09FE44734EB7990E \ | ||
| 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ | ||
| DD8F2338BAE7501E3DD5AC78C273792F7D83545D \ | ||
| B9AE9905FFD7803F25714661B63B535A4C206CA9 \ | ||
| C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ | ||
| ; do \ | ||
| gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ | ||
| done \ | ||
| && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \ | ||
| && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \ | ||
| && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \ | ||
| && grep " node-v$NODE_VERSION.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ | ||
| && tar -xf "node-v$NODE_VERSION.tar.xz" \ | ||
| && cd "node-v$NODE_VERSION" \ | ||
| && ./configure \ | ||
| && make -j$(getconf _NPROCESSORS_ONLN) \ | ||
| && make install \ | ||
| && apk del .build-deps \ | ||
| && cd .. \ | ||
| && rm -Rf "node-v$NODE_VERSION" \ | ||
| && rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \ | ||
| && npm install -g svgo \ | ||
|
|
||
| ;fi | ||
|
|
||
| ## Add composer | ||
| RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ | ||
| php composer-setup.php && \ | ||
| mv composer.phar /bin/composer && \ | ||
| php -r "unlink('composer-setup.php');" | ||
|
|
||
| RUN apk del autoconf \ | ||
| automake \ | ||
| build-base \ | ||
| libtool \ | ||
| nasm | ||
|
|
||
| WORKDIR /image-minify/web | ||
|
|
||
| CMD ["php", "-S", "0.0.0.0:8080"] | ||
|
|
||
| EXPOSE 8080 | ||
This file contains hidden or 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,36 @@ | ||
| version: '2' | ||
|
|
||
|
|
||
| services: | ||
|
|
||
| php: | ||
| build: | ||
| context: . | ||
| args: | ||
| - INSTALL_PNGQUANT=true | ||
| - INSTALL_MOZJPEG=true | ||
| - INSTALL_GIFSICLE=true | ||
| - INSTALL_SVGO=true | ||
| volumes: | ||
| - .:/image-minify | ||
| ports: | ||
| - "0.0.0.0:8080:8080" | ||
| links: | ||
| - mysql:mysql | ||
|
|
||
| mysql: | ||
| image: mysql:5.7 | ||
| ports: | ||
| - "0.0.0.0:3306:3306" | ||
| environment: | ||
| - MYSQL_ROOT_PASSWORD=image | ||
| - MYSQL_DATABASE=image-minify-api | ||
| - MYSQL_USER=image | ||
| - MYSQL_PASSWORD=image | ||
|
|
||
|
|
||
| ### Volumes Setup ########################################### | ||
|
|
||
| volumes: | ||
| mysql: | ||
| driver: "local" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace the URL by http://dl-4.alpinelinux.org/alpine/edge/community to enable installing pngquant again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that worked for me. For some reason, I had to install composer manually though