GithubHelp home page GithubHelp logo

firegurafiku / flarum-dockerfile Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 7 KB

Dockerfile to build a container with Flarum, php-fpm and nginx.

License: MIT License

PHP 19.05% Nginx 27.59% Shell 53.36%

flarum-dockerfile's Introduction

Dockerized Flarum with Russian localization

This repository contains a Dockerfile for building firegurafiku/flarum image. It's an attempt to containerize Flarum forum application (written in modern PHP) and a bunch of its extensions with Nginx, PHP-FPM and everything else which is required for the forum to run (except a database server).

Example deploy

You don't have to rebuild anything from source if you want to deploy an unmodified image. Just pull one from DockerHub, as well as a MariaDB instance. You may use the following script to get a running forum in seconds, but don't forget to adjust your settings:

#!/bin/sh
set -o nounset
set -o errexit

# --- Adjust options here. ---
# Please, avoid using backslashes and quotes in these variables,
# or envsubst-based templating may fail. You should really adjust
# only the "<here>" entries.
networkName="flarum-network"
mariadbContainerName="flarum-mariadb"
mariadbDatabaseName="flarum"
mariadbDatabaseUser="flarum"
mariadbDatabasePass="<here>"
flarumContainerName="flarum"
flarumHostname="localhost"
flarumPerformInstall="yes"
flarumDatabasePrefix=""
flarumAdminName="admin"
flarumAdminEmail="[email protected]"
flarumAdminPass="<here>"

# --- Let's go. ---

sudo docker network create "$networkName"

sudo docker run \
    -e MYSQL_DATABASE="$mariadbDatabaseName" \
    -e MYSQL_USER="$mariadbDatabaseUser" \
    -e MYSQL_PASSWORD="$mariadbDatabasePass" \
    -e MYSQL_ROOT_PASSWORD="$mariadbDatabasePass" \
    --net="$networkName" \
    --net-alias="$mariadbContainerName" \
    --name "$mariadbContainerName" \
    --detach \
            mariadb

echo "Waiting for MariaDB to initialize (30 sec)..."
sleep 30s

sudo docker run \
    -e flarumPerformInstall="$flarumPerformInstall" \
    -e flarumDbHost="$mariadbContainerName" \
    -e flarumDbName="$mariadbDatabaseName" \
    -e flarumDbUser="$mariadbDatabaseUser" \
    -e flarumDbPass="$mariadbDatabasePass" \
    -e flarumHostname="$flarumHostname" \
    -e flarumDbPrefix="$flarumDatabasePrefix" \
    -e flarumAdminName="$flarumAdminName" \
    -e flarumAdminEmail="$flarumAdminEmail" \
    -e flarumAdminPass="$flarumAdminPass" \
    --net="$networkName" \
    --net-alias="$flarumContainerName" \
    --name="$flarumContainerName" \
    --publish 80:80 \
    --detach \
        firegurafiku/flarum

flarum-dockerfile's People

Contributors

firegurafiku avatar

Stargazers

 avatar

Watchers

 avatar  avatar

flarum-dockerfile's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.