Skip to content
Snippets Groups Projects
Verified Commit 638e0100 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

feat: Initial version of new multi-container structure

parent ba28a287
No related branches found
No related tags found
No related merge requests found
build: seahub:
stage: build stage: build
image: image:
name: gcr.io/kaniko-project/executor:debug name: gcr.io/kaniko-project/executor:debug
...@@ -6,4 +6,13 @@ build: ...@@ -6,4 +6,13 @@ build:
script: script:
- mkdir -p /kaniko/.docker - mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA} --destination $CI_REGISTRY_IMAGE:latest - /kaniko/executor --context seahub/$CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/seahub/Dockerfile --destination $CI_REGISTRY_IMAGE:seahub-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA} --destination $CI_REGISTRY_IMAGE:seahub
server:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context server/$CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/server/Dockerfile --destination $CI_REGISTRY_IMAGE:server-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA} --destination $CI_REGISTRY_IMAGE:server
FROM ubuntu:18.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-setuptools \
wget
RUN python3.6 -m pip install --upgrade pip && rm -r /root/.cache/pip
RUN pip3 install \
click \
termcolor \
colorlog \
psycopg2-binary \
django==1.11.29 \
Pillow \
pylibmc \
captcha \
jinja2 \
sqlalchemy \
psd-tools \
django-pylibmc \
django-simple-captcha \
python3-ldap \
&& rm -r /root/.cache/pip
# add entrypoints
ADD src/setenv.sh /
ADD src/docker-entrypoint.sh /
# set environment variables for locale
ARG LANG=C.UTF-8
ARG LANGUAGE=C.UTF-8
ARG LC_ALL=C.UTF-8
# set environment variables for seafile
ARG ROOTPATH=/haiwen
ARG INSTALLPATH=$ROOTPATH/seafile-server-latest
ENV CCNET_CONF_DIR=$ROOTPATH/ccnet
ENV SEAFILE_CENTRAL_CONF_DIR=$ROOTPATH/conf
ENV SEAFILE_CONF_DIR=$ROOTPATH/seafile-data
ENV GC_AT_STARTUP=false
# setup user environment
RUN addgroup --gid 1000 seafile && \
adduser --gid 1000 --uid 1000 --system --shell /bin/bash --home $ROOTPATH seafile
USER seafile
VOLUME $SEAFILE_CONF_DIR
RUN wget https://download.seadrive.org/seafile-server_8.0.5_x86-64.tar.gz -O /tmp/seafile-server.tar.gz && \
tar -C /tmp/ -xzvf /tmp/seafile-server.tar.gz && \
rm /tmp/seafile-server.tar.gz && \
mv /tmp/seafile-server-* $INSTALLPATH
ENTRYPOINT ["/docker-entrypoint.sh"]
IMAGE := k8r.eu/justjanne/$(shell basename $(shell git remote get-url origin) .git)
TAGS := $(shell git describe --always --tags HEAD)
.PHONY: build
build:
docker build --pull -t $(IMAGE):$(TAGS) .
docker tag $(IMAGE):$(TAGS) $(IMAGE):latest
@echo Successfully tagged $(IMAGE):$(TAGS) as latest
.PHONY: push
push: build
docker push $(IMAGE):$(TAGS)
docker push $(IMAGE):latest
@echo Successfully pushed $(IMAGE):$(TAGS) as latest
FROM ubuntu:18.04
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y ssh \
libevent-dev \
libcurl4-openssl-dev \
libglib2.0-dev \
uuid-dev \
intltool \
libsqlite3-dev \
libmysqlclient-dev \
libarchive-dev \
libtool \
libjansson-dev \
valac \
libfuse-dev \
cmake \
re2c \
flex \
sqlite3 \
python-pip \
python-simplejson \
git \
libssl-dev \
libldap2-dev \
libonig-dev \
vim \
vim-scripts \
wget \
cmake \
gcc \
autoconf \
automake \
mysql-client \
postgresql-client \
libpq-dev \
librados-dev \
libxml2-dev \
curl \
telnet \
netcat \
unzip \
netbase \
ca-certificates \
apt-transport-https \
build-essential \
libxslt1-dev \
libffi-dev \
libpcre3-dev \
libz-dev \
xz-utils \
nginx \
pkg-config \
poppler-utils \
libmemcached-dev
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
RUN apt-get install -y python3-pip python3 python3-dev
RUN python3 -m pip install --upgrade pip
RUN rm /usr/bin/python
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN rm /usr/bin/pip
RUN ln -s /usr/local/bin/pip3 /usr/bin/pip
RUN pip install \
python-cas \
djangosaml2 \
cffi \
sqlalchemy \
pymysql \
pillow \
pycryptodome \
configparser \
pylibmc \
django-pylibmc \
elasticsearch==5.5.0 \
elasticsearch-dsl==5.4.0 \
Django==2.2.14 \
future \
captcha \
django-statici18n \
django-post_office==3.3.0 \
django-webpack_loader==0.7.0 \
gunicorn \
mysqlclient \
django-picklefield==2.1.1 \
openpyxl \
qrcode \
django-formtools \
django-simple-captcha \
djangorestframework==3.11.1 \
python-dateutil \
requests \
pillow \
pyjwt \
pycryptodome \
requests_oauthlib \
mock \
nose \
exam \
splinter \
pytest \
pytest-django \
psycopg2
RUN mkdir /source
WORKDIR /source
RUN git clone https://github.com/haiwen/libevhtp.git
RUN git clone https://github.com/haiwen/libsearpc.git
RUN git clone --single-branch --branch=feat/postgres-support https://github.com/justjanne/seafile-server.git
RUN git clone --single-branch --branch=feat/postgres-support https://github.com/justjanne/seahub.git
WORKDIR /source/libevhtp
RUN cmake -DEVHTP_DISABLE_SSL=ON -DEVHTP_BUILD_SHARED=OFF .
RUN make
RUN make install
RUN ldconfig
WORKDIR /source/libsearpc
RUN ./autogen.sh
RUN ./configure
RUN make
RUN make install
RUN ldconfig
WORKDIR /source/seafile-server
RUN ./autogen.sh
RUN ./configure --disable-fuse
RUN make
RUN make install
RUN ldconfig
WORKDIR /source/seahub/frontend
RUN npm install
RUN npm run build
ADD entrypoint.sh /
WORKDIR /source/seahub
ENV PYTHONPATH="/usr/local/lib/python3.6/site-packages/:/source/seahub/thirdpart:$PYTHONPATH"
ENV CCNET_CONF_DIR="/conf"
ENV SEAFILE_CONF_DIR="/tmp"
ENV SEAFILE_CENTRAL_CONF_DIR="/conf"
ENTRYPOINT ["/entrypoint.sh"]
#!/bin/sh
python3 manage.py collectstatic
python3 manage.py migrate
python3 manage.py runserver 0.0.0.0:8000
FROM ubuntu:18.04
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y ssh \
libevent-dev \
libcurl4-openssl-dev \
libglib2.0-dev \
uuid-dev \
intltool \
libsqlite3-dev \
libmysqlclient-dev \
libarchive-dev \
libtool \
libjansson-dev \
valac \
libfuse-dev \
cmake \
re2c \
flex \
sqlite3 \
python-pip \
python-simplejson \
git \
libssl-dev \
libldap2-dev \
libonig-dev \
vim \
vim-scripts \
wget \
cmake \
gcc \
autoconf \
automake \
mysql-client \
postgresql-client \
libpq-dev \
librados-dev \
libxml2-dev \
curl \
telnet \
netcat \
unzip \
netbase \
ca-certificates \
apt-transport-https \
build-essential \
libxslt1-dev \
libffi-dev \
libpcre3-dev \
libz-dev \
xz-utils \
nginx \
pkg-config \
poppler-utils \
libmemcached-dev
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get install -y nodejs
RUN apt-get install -y python3-pip python3 python3-dev
RUN python3 -m pip install --upgrade pip
RUN rm /usr/bin/python
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN rm /usr/bin/pip
RUN ln -s /usr/local/bin/pip3 /usr/bin/pip
RUN pip install \
python-cas \
djangosaml2 \
cffi \
sqlalchemy \
pymysql \
pillow \
pycryptodome \
configparser \
pylibmc \
django-pylibmc \
elasticsearch==5.5.0 \
elasticsearch-dsl==5.4.0 \
Django==2.2.14 \
future \
captcha \
django-statici18n \
django-post_office==3.3.0 \
django-webpack_loader==0.7.0 \
gunicorn \
mysqlclient \
django-picklefield==2.1.1 \
openpyxl \
qrcode \
django-formtools \
django-simple-captcha \
djangorestframework==3.11.1 \
python-dateutil \
requests \
pillow \
pyjwt \
pycryptodome \
requests_oauthlib \
mock \
nose \
exam \
splinter \
pytest \
pytest-django
RUN mkdir /source
WORKDIR /source
RUN git clone https://github.com/haiwen/libevhtp.git
RUN git clone https://github.com/haiwen/libsearpc.git
RUN git clone --single-branch --branch=feat/postgres-support https://github.com/justjanne/seafile-server.git
WORKDIR /source/libevhtp
RUN cmake -DEVHTP_DISABLE_SSL=ON -DEVHTP_BUILD_SHARED=OFF .
RUN make
RUN make install
RUN ldconfig
WORKDIR /source/libsearpc
RUN ./autogen.sh
RUN ./configure
RUN make
RUN make install
RUN ldconfig
WORKDIR /source/seafile-server
RUN ./autogen.sh
RUN ./configure --disable-fuse
RUN make
RUN make install
RUN ldconfig
VOLUME /conf
VOLUME /data
VOLUME /tmp
ENTRYPOINT ["seaf-server", "--central-config-dir", "/conf", "--seafdir", "/data", "--debug", "all", "--rpc-pipe-path", "/tmp", "--foreground", "--log", "-"]
#!/bin/bash
source setenv.sh
if [[ "$GC_ON_STARTUP" = "true" ]]; then
$INSTALLPATH/seaf-gc.sh
fi
$INSTALLPATH/seafile.sh start
$INSTALLPATH/seahub.sh start
tail -f $ROOTPATH/logs/ccnet.log &
tail -f $ROOTPATH/logs/seahub.log &
tail -f $ROOTPATH/logs/seafile.log &
tail -f $ROOTPATH/logs/controller.log &
maxretry=4
retry=0
while [ "$retry" -le "$maxretry" ]; do
ps aux | grep seafile-controller | grep -v grep > /dev/null 2> /dev/null || {
retry=$(expr $retry + 1);
}
sleep 5
done
echo "Seafile not running"
exit 1
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python2.7/site-packages:${INSTALLPATH}/seafile/lib64/python2.7/site-packages:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment