Skip to content
Snippets Groups Projects
Commit 33fcb171 authored by kaiyou's avatar kaiyou
Browse files

Build a Docker image from source

parent 59752ce2
Branches tedomum-prod
No related tags found
No related merge requests found
Pipeline #6091 passed
.git
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- build
build:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- 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_REF_SLUG
only:
- branches
[submodule "3rdparty"]
path = 3rdparty
url = https://github.com/nextcloud/3rdparty.git
[submodule "apps/viewer"]
path = apps/viewer
url = https://github.com/nextcloud/viewer.git
branch = v21.0.2
[submodule "apps/tasks"]
path = apps/tasks
url = https://github.com/nextcloud/tasks
[submodule "apps/notes"]
path = apps/notes
url = https://github.com/nextcloud/notes
[submodule "apps/groupfolders"]
path = apps/groupfolders
url = https://github.com/nextcloud/groupfolders
[submodule "apps/contacts"]
path = apps/contacts
url = https://github.com/nextcloud/contacts
[submodule "apps/activity"]
path = apps/activity
url = https://github.com/nextcloud/activity
[submodule "apps/calendar"]
path = apps/calendar
url = https://github.com/nextcloud/calendar
[submodule "apps/files_pdfviewer"]
path = apps/files_pdfviewer
url = https://github.com/nextcloud/files_pdfviewer
[submodule "apps/guests"]
path = apps/guests
url = https://github.com/nextcloud/guests
[submodule "apps/files_texteditor"]
path = apps/files_texteditor
url = https://github.com/nextcloud/files_texteditor
[submodule "apps/deck"]
path = apps/deck
url = https://github.com/nextcloud/deck
[submodule "apps/files_videoplayer"]
path = apps/files_videoplayer
url = https://github.com/nextcloud/files_videoplayer
[submodule "apps/files_rightclick"]
path = apps/files_rightclick
url = https://github.com/nextcloud/files_rightclick
[submodule "apps/photos"]
path = apps/photos
url = https://github.com/nextcloud/photos
# First load all sources and download vendor PHP packages
FROM composer:2
COPY 3rdparty /app/3rdparty
COPY core /app/core
COPY lib /app/lib
COPY ocs /app/ocs
COPY ocm-provider /app/ocm-provider
COPY ocs-provider /app/ocs-provider
COPY resources /app/resources
COPY themes /app/themes
COPY occ robots.txt .htaccess *.php /app/
COPY apps /app/apps
RUN for app in `ls /app/apps`; do \
cd /app/apps/$app; \
[ ! -f composer.json ] || composer install --no-dev; \
done;
# Then build all assets for applications
FROM node:15-alpine
RUN apk add --no-cache python2 python3 make g++
COPY --from=0 /app /app
RUN for app in `ls /app/apps`; do \
cd /app/apps/$app; \
[ ! -f package.json ] || (npm ci && npm run build); \
done
RUN rm -rf /app/apps/*/node_modules \
/app/apps/*/Makefile \
/app/apps/*/*.js \
/app/apps/*/*.md \
/app/apps/*/*.xml \
/app/apps/*/*.json \
/app/apps/*/*.lock \
/app/apps/*/src \
/app/apps/*/tests \
/app/apps/*/.[^.]*
# Install the app on top of a PHP fpm image
FROM php:8-fpm-alpine
RUN apk add --no-cache \
libzip libjpeg-turbo freetype libpng gmp libintl icu-libs \
libpq nginx \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
libjpeg-turbo-dev libzip-dev freetype-dev libpng-dev gmp-dev \
postgresql-dev \
&& docker-php-ext-configure gd \
--enable-gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd zip opcache pdo pdo_pgsql intl bcmath gmp \
&& pecl install apcu-5.1.20 \
&& docker-php-ext-enable apcu \
&& apk del --no-network .build-deps
COPY --from=1 /app ./
COPY docker /docker
RUN mkdir ./config \
&& mv /docker/*.php ./config/ \
&& mv /docker/*.ini /usr/local/etc/php/conf.d/ \
&& mv /docker/www.conf /usr/local/etc/php-fpm.d \
&& mv /docker/nginx.conf /etc/nginx/ \
&& mkdir /run/nginx
Subproject commit 432a6323d3ae49050642664d2c11c93faaa0a325
Subproject commit d0d241459709c5fdc986cd23403099f7cce15c7e
Subproject commit 1e2950d15500f194607f81291458d78d8a22a2f8
Subproject commit bd8fd6a66b66af35ae19f7cec3df6f107656e49f
Subproject commit 8a0b548c265f6cd78c12cf2cb917e48bce1308d8
Subproject commit b9a43054ad7433af5a8051a21bed072ac97c5116
Subproject commit 09bd51083462799b34c5172a8507db32eefe7e06
Subproject commit da6e169866ec06f4359aacfdeae14a6c7e796255
Subproject commit 0bc7b69fb0a05fcf65dd0209e3fc47d57bb68b59
Subproject commit 48d6ab381f67a8881ddedaf09241a3507feed520
Subproject commit ec246e5890b9805a70959f341504736461413c65
Subproject commit 955c74ea729d39e4ad95239f0d12ae799e23d6e8
Subproject commit d5205a59e71e6cfe09db5ceb2463b70209df6c1c
Subproject commit 8b5d7be6e6414eff5531c7ba75650fabe0ae8f0c
<?php
$CONFIG = [
'htacess.RewriteBase' => '/',
'maintenance' => false,
'config_is_read_only' => true,
'log_type' => 'errorlog',
'appstoreenabled' => false,
'upgrade.disable-web' => true,
'memcache.local' => '\\OC\\Memcache\\APCu',
'apps_paths' => [[
'path' => '/var/www/html/apps',
'url' => '/apps',
'wriable' => false
]]
];
<?php
// Explicitely empty file to avoid Nextcloud trying to rewrite it
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment