Skip to content
Snippets Groups Projects
Verified Commit 5e481b14 authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Pipeline #7607 passed
image: docker:20.10.12
variables:
DOCKER_TLS_CERTDIR: "/certs"
BUILD_VERSION: 1
services:
- docker:20.10.12-dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- SRC_VERSION=`grep VERSION Dockerfile | cut -d '=' -f 2`
- VERSION="${SRC_VERSION}-${BUILD_VERSION}"
build:
stage: build
script:
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$VERSION --tag $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:$VERSION
- docker push $CI_REGISTRY_IMAGE:latest
FROM php:7-apache-bullseye
LABEL maintainer="andrej.ramaseuski@pirati.cz"
ARG VERSION=2.0.4
ARG REPO=https://github.com/mettle/sendportal.git
# Install requirements
RUN apt-get update && apt-get -y --no-install-recommends install \
libsodium-dev \
libsodium23 \
libzip-dev \
libzip4 \
libpq-dev \
libpq5 \
npm \
git \
&& rm -rf /var/lib/apt/lists/*
# Install PHP plugins
RUN docker-php-ext-install pcntl sodium zip pgsql pdo pdo_pgsql
# Install composer
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
# Download and unpack sendportal
# RUN curl -sL "${APP}" | tar -xzC /var/www/html
RUN cd /var/www/html && git clone --depth 1 ${REPO}
# Install SendPortal and its dependencies
RUN cd /var/www/html/sendportal && \
composer install
RUN chown -R www-data /var/www/html/sendportal/storage && \
a2enmod rewrite && \
sed -i "s#www/html#www/html/sendportal/public#" /etc/apache2/sites-available/000-default.conf
COPY entrypoint.sh entrypoint.sh
EXPOSE 443
ENTRYPOINT ["/var/www/html/entrypoint.sh"]
CMD ["apache2-foreground"]
#!/bin/bash
# Entrypoint for SendPortal
echo "
APP_NAME=\"${APP_NAME:-SendPortal}\"
APP_ENV=${APP_ENV:-local}
APP_KEY=${APP_KEY}
APP_DEBUG=${APP_DEBUG:-false}
APP_URL=${APP_URL:-http://localhost:3000}
LOG_CHANNEL=${LOG_CHANNEL:-stack}
DB_CONNECTION=${DB_CONNECTION:-pgsql}
DB_HOST=${DB_HOST:-127.0.0.1}
DB_PORT=${DB_PORT:-5432}
DB_DATABASE=${DB_DATABASE:-sendportal}
DB_USERNAME=${DB_USERNAME:-sendportal}
DB_PASSWORD=${DB_PASSWORD}
BROADCAST_DRIVER=${BROADCAST_DRIVER:-log}
CACHE_DRIVER=${CACHE_DRIVER:-file}
QUEUE_CONNECTION=${QUEUE_CONNECTION:-sync}
SESSION_DRIVER=${SESSION_DRIVER:-file}
SESSION_LIFETIME=${SESSION_LIFETIME:-120}
REDIS_HOST=${REDIS_HOST:-127.0.0.1}
REDIS_PASSWORD=${REDIS_PASSWORD:-null}
REDIS_PORT=${REDIS_PORT:-6379}
MAIL_MAILER=${MAIL_MAILER:-smtp}
MAIL_HOST=${MAIL_HOST:-smtp.mailtrap.io}
MAIL_PORT=${MAIL_PORT:-25}
MAIL_USERNAME=${MAIL_USERNAME:-null}
MAIL_PASSWORD=${MAIL_PASSWORD:-null}
MAIL_ENCRYPTION=${MAIL_ENCRYPTION:-null}
MAIL_FROM_ADDRESS=${MAIL_FROM_ADDRESS:-null}
MAIL_FROM_NAME=\"${MAIL_FROM_NAME}\"
MAILGUN_DOMAIN=${MAILGUN_DOMAIN}
MAILGUN_SECRET=${MAILGUN_SECRET}
MAILGUN_ENDPOINT=${MAILGUN_ENDPOINT}
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:-us-east-1}
AWS_BUCKET=${AWS_BUCKET:-}
PUSHER_APP_ID=${PUSHER_APP_ID}
PUSHER_APP_KEY=${PUSHER_APP_KEY}
PUSHER_APP_SECRET=${PUSHER_APP_SECRET}
PUSHER_APP_CLUSTER=${PUSHER_APP_CLUSTER:-mt1}
MIX_PUSHER_APP_KEY=${PUSHER_APP_KEY}
MIX_PUSHER_APP_CLUSTER=${PUSHER_APP_CLUSTER}
SENDPORTAL_THROTTLE_MIDDLEWARE=${SENDPORTAL_THROTTLE_MIDDLEWARE:-60,1}
SENDPORTAL_REGISTER=${SENDPORTAL_REGISTER:-false}
SENDPORTAL_PASSWORD_RESET=${SENDPORTAL_PASSWORD_RESET:-true}
" > /var/www/html/sendportal/.env
cd /var/www/html/sendportal
php artisan vendor:publish --provider=Sendportal\\Base\\SendportalBaseServiceProvider
php artisan migrate
exec "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment