Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed May 21, 2018
2 parents 7e35d58 + fe675b1 commit 8c7b5d1
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 19 deletions.
13 changes: 13 additions & 0 deletions tools/docker/cells-php/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM php:7-fpm-alpine

RUN apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev && \
docker-php-ext-configure gd \
--with-gd \
--with-freetype-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ && \
NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
docker-php-ext-install -j${NPROC} gd && \
apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev

RUN chmod +rx /root
File renamed without changes.
18 changes: 18 additions & 0 deletions tools/docker/cells/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
set -e

# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- cells "$@"
fi

if [ "$1" == "cells" ]; then
FILE="/root/.config/pydio/cells/pydio.json"
if [ ! -f $FILE ] ; then
cells install --bind $CELLS_BIND --external $CELLS_EXTERNAL "$@"
else
"$@"
fi
else
exec "$@"
fi
11 changes: 6 additions & 5 deletions tools/docker/dockerfile → tools/docker/cells/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@ FROM busybox:glibc

ENV CELLS_VERSION 1.0.0

ADD cmd.sh /cells/cmd.sh
ADD libdl.so.2 /cells/libdl.so.2
COPY docker-entrypoint.sh /cells/docker-entrypoint.sh
COPY libdl.so.2 /cells/libdl.so.2

WORKDIR /cells

RUN wget "https://download.pydio.com/pub/cells/release/${CELLS_VERSION}/linux-amd64/cells"

RUN chmod +x /cells/cells
RUN chmod +x /cells/cmd.sh
RUN chmod +x /cells/docker-entrypoint.sh

RUN ln -s /cells/cells /bin/cells
RUN ln -s /cells/libdl.so.2 /lib64/libdl.so.2
RUN ln -s /cells/docker-entrypoint.sh /bin/docker-entrypoint.sh

ENV CELLS_BIND localhost:8080
ENV CELLS_EXTERNAL localhost:8080

VOLUME /root/.config
ENTRYPOINT ["docker-entrypoint.sh"]

CMD ["/cells/cmd.sh"]
CMD ["cells", "start"]
File renamed without changes.
7 changes: 0 additions & 7 deletions tools/docker/cmd.sh

This file was deleted.

15 changes: 8 additions & 7 deletions tools/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@ services:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: P@ssw0rd
MYSQL_DATABASE: pydio
MYSQL_DATABASE: cells
MYSQL_USER: pydio
MYSQL_PASSWORD: P@ssw0rd
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci]
ports: ["3306:3306"]
php:
image: php:fpm-alpine
volumes: ["static:/var/www/html"]
image: cells-php:latest
volumes: ["static:/root/.config/pydio/cells/static/pydio"]
cells:
image: cells:latest
volumes: ["static:/root/.config/static/pydio", "data:/root/.config/data"]
ports: ["8081:8080"]
links:
- mysql
volumes: ["static:/root/.config/pydio/cells/static/pydio", "data:/root/.config/pydio/cells/data"]
ports: ["8080:8080"]
environment:
- CELLS_BIND=cells:8080
- CELLS_EXTERNAL=cells:8080

volumes:
static: {}
Expand Down

0 comments on commit 8c7b5d1

Please sign in to comment.