Sign inSign up

patriceckhart/docker-neos-alpine

By patriceckhart

Updated about 5 years ago

Neos CMS docker image based on Alpine linux with nginx + php-fpm 7.4 🚀

Image
0

10K+

patriceckhart/docker-neos-alpine repository overview

patriceckhart/docker-neos-alpine

Neos CMS 🐳 docker image based on Alpine linux with nginx + php-fpm 7.4 🚀, packing everything needed for development and production usage of Neos.

The image does a few things:

Automatically install and provision a Neos CMS website or a Neos Flow application, based on environment vars documented below. Pack a few useful things like git, redis, automated update mechanism + a simple ci-pipeline, etc.

Usage

This image supports following environment variable for automatically configuring Neos at container startup:

Required env vars
Docker env varDescription
REPOSITORY_URLLink to Neos CMS website distribution
GITHUB_USERNAMEWill pull authorized keys allowed to connect to the container via ssh
Optional env vars
Docker env varDescription
GITHUB_TOKENGithub Token for clone private repositories
DB_DATABASEDatabase name, defaults to neos
DB_USERDatabase user, defaults to admin
DB_PASSDatabase password, defaults to pass
DB_HOSTDatabase host, defaults to mariadb
SITE_PACKAGENeos CMS website package with exported website data to be imported
ADMIN_PASSWORDIf set, would create a Neos CMS admin user with such password
EDITOR_USERNAMEIf set, would create a Neos CMS editor user
EDITOR_PASSWORDPassword for the editor user if defined
EDITOR_FIRSTNAMEFirstname of editor user
EDITOR_LASTNAMELastname of editor user
EDITOR_ROLEIndividual user group/role for the editor user
CONTAINERNAMEContainer name for different processes around the container
VIRTUAL_HOSTVirtual host if a Nginx proxy is used
UPDATEPACKAGESdaily, weekly, monthly Auto-Update Neos installation including all packages with composer update
PERSISTENT_RESOURCES_FALLBACK_BASE_URIhttp://foo.bar The live url to load locally unavailable resources
Example docker-compose.yml configuration
web:
  image: patriceckhart/docker-neos-alpine
  ports:
    - '80'
    - '22:22'
  links:
    - mariadb:mariadb
  volumes:
    - /data
  environment:
    # If you use a GITHUB_TOKEN, just enter YourGitRepo.git as GITHUB_REPOSITORY
    - GITHUB_REPOSITORY=https://github.com/yourgitaccount/YourGitRepo
    # - GITHUB_REPOSITORY=YourGitRepo.git
    #- GITHUB_TOKEN=9a72f0aca3c52463b17464k2277833x58037ff68
    - GITHUB_USERNAME=yourgitusername
    # When using the following ENV, a database and a privileged user must already be created, otherwise the container will crash
    - DB_DATABASE=neos
    - DB_USER=admin
    - DB_PASS=pass
    - DB_HOST=mariadb
    # Neos CMS site import
    - SITE_PACKAGE=Your.Site
    # Neos CMS User
    - ADMIN_PASSWORD=password
    #- CONTAINERNAME=yourneos
    #- VIRTUAL_HOST=dev.neos.local
    #- PERSISTENT_RESOURCES_FALLBACK_BASE_URI=http://foo.bar

mariadb:
  image: mariadb:latest
  expose:
    - 3306
  volumes:
    - /var/lib/data
  environment:
    MYSQL_DATABASE: 'neos'
    MYSQL_USER: 'admin'
    MYSQL_PASSWORD: 'pass'
    MYSQL_ROOT_PASSWORD: 'root'
  ports:
    - '3306:3306'
  command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
Cronjobs

In /data/cron there are folders named 1min, 15min, hourly, daily, weekly and monthly. Files can be stored in this folder in the following scheme: 100-backup, 200-update, 300-customname, ...

Example 100-backup in /data/cron/daily
#!/bin/sh

cd /data/neos && ./flow backup:create

Don't forget: chmod 775 100-backup

SSH Access

For development with your favorite IDE you can ssh into the container:

ssh [email protected] -p <portnumber> -i ~/.ssh/yourPrivateSshKeyFile

Helpful cli scripts ### (usage: docker exec ... or kubectl exec ...)
CLI commandDescription
updateneosUpdate Neos installation including all packages with composer-update
setfilepermissionsAdjust file permissions for CLI and web server access
flushcacheFlush all development and production caches
flushcachedevFlush all development caches
flushcacheprodFlush all production caches
For development (only works with docker exec ... or kubectl exec ...)
CLI commandDescription
pullappPulls latest code from git repository

Tag summary

Content type

Image

Digest

Size

218.3 MB

Last updated

about 5 years ago

docker pull patriceckhart/docker-neos-alpine