项目作者: samuelantonioli

项目描述 :
Wordpress, TYPO3, PHP, Apache and MySQL in Docker - using Alpine Linux
高级语言: Dockerfile
项目地址: git://github.com/samuelantonioli/gaia.git
创建时间: 2017-02-18T01:50:31Z
项目社区:https://github.com/samuelantonioli/gaia

开源协议:

下载


TYPO3 Docker a.k.a “Gaia”

  1. #docker #typo3 #cms #apache #php #mysql #mariadb #LAMP #alpine #linux

This repository contains three Dockerfiles
that enable a simple installation of TYPO3 servers.

  • typo3: server with TYPO3
  • server: server with apache und php
  • database: MySQL database

The Dockerfiles are based on Alpine Linux
because it’s much smaller than other linux distributions.

Installation

The installation of gaia only needs to happen once.

  1. git clone https://github.com/samuelantonioli/gaia.git && cd gaia
  2. docker build -f database/Dockerfile -t gaia:database database
  3. docker build -f server/Dockerfile -t gaia:server -t gaia server
  4. docker build -f typo3/Dockerfile -t gaia:typo3 typo3

TYPO3 setup

A common use case is to install TYPO3 locally and uncomplicated.
The projectname should be replaced everywhere with your project
name in the following shell commands.
It should only contain letters, numbers, dashes and underscores.

The TYPO3 installation can be found
under /opt/typo3/src.

Setup

Only once for each TYPO3 installation:

  1. docker run --name projectname-db -e MYSQL_ROOT_PASSWORD=password -d gaia:database
  2. docker run --name projectname -p 8080:80 -p 4443:443 --link projectname-db:db -d gaia:typo3

Using TYPO3

After the installation,
it can be started and closed with the following commands:

  1. docker start projectname-db
  2. docker start projectname
  3. # instance can be found at localhost:8080
  4. # stop the instance
  5. docker stop projectname
  6. docker stop projectname-db

While installing TYPO3:
Use db as hostname for the database.

Delete TYPO3 installation

Make sure you’ve stopped the instance before.
Be careful! The installation will be deleted permanently!

  1. docker rm projectname-db
  2. docker rm projectname

Access the docker container

It is possible to open a bash in the docker container:

  1. docker exec -it containername bash

You can see all running docker instances using docker ps.
You can see all instances with docker ps -a.

Database or server setup

You can also use the images independently,
i.e. you can start database and server instances
without using TYPO3.

Database setup

Replace dbname with the name you want to use.

  1. # Setup
  2. docker run --name dbname -e MYSQL_ROOT_PASSWORD=password -d gaia:database
  3. # Use it
  4. docker start dbname
  5. docker stop dbname
  6. # Delete
  7. docker rm dbname

Server setup

Apache and PHP7. Replace servername with the name you want to use.
You can mount a directory from your host system in your docker instance using -v.

  1. # Setup
  2. docker run --name servername -v /path/to/your/files:/var/www/localhost/htdocs/ -d gaia:server
  3. # Use
  4. docker start servername
  5. docker stop servername
  6. # Delete
  7. docker rm servername

Using both

If you want to use the database and the server together e.g. for Wordpress,
you can do the following (similar to TYPO3 setup):

  1. # :server instead of :typo3
  2. docker run --name projectname -p 8080:80 -p 4443:443 --link projectname-db:db -d gaia:server

Credits

Roadmap

  • Defining standard configurations (PHP, Apache, SSL)
  • use docker-compose
  • use PHP-FPM
  • use a Supervisor