Sign inSign up

chopin2712/flarum

By chopin2712

•Updated over 3 years ago

Quick a dirty flarum Docker image

Image
0

181

chopin2712/flarum repository overview

⁠Run it

  1. Create a docker-compose.yml with the following content: (just change the password)
version: "3"

services:
  flarum:
    image: chopin2712/flarum:latest
    container_name: flarum
    volumes:
      - data:/flarum/app
    ports:
      - 8888:80
    depends_on:
      - mariadb

  mariadb:
    image: mariadb:10.5
    container_name: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=supersecurepassword
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=supersecurepassword
    volumes:
      - db:/var/lib/mysql

volumes:
  data:
  db:
  1. Run it
sudo docker-compose up -d
  1. Go on http://your-server:8888 and fill those db info:
  • Host: mariadb
  • Username: flarum
  • Database name: flarum
  • Password: your password
  • Prefix: flarum_

⁠Build it yourself

  1. Create a Dockerfile with the following content :
# This file suffers from an optimisation problem due to using debian instead of alpine
FROM debian:latest

# Install php, php extensions, php-fpm, composer and nginx
RUN apt-get update && apt install -y php7.4-fpm php7.4-curl php7.4-dom php7.4-gd php7.4-json php7.4-mbstring php7.4-mysql php7.4-tokenizer php7.4-zip nginx composer

# Install flarum
RUN mkdir /flarum && composer create-project flarum/flarum /flarum

# Configure the file permissions
RUN chmod 775 -R /flarum && chown www-data:www-data -R /flarum

# Configures php-fpm and nginx
RUN mkdir -p /run/php # This just creates the location where php-fpm will get started
ADD nginx.conf /etc/nginx/sites-enabled/default

# Add the starting script for php-fpm and nginx
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
CMD [ "/entrypoint.sh" ]
  1. Build it
docker build . -t my-flarum
  1. Minify it using docker-slim
docker-slim build --target my-flarum --expose 80 --preserve-path /flarum --tag chopin2712/flarum

Tag summary

Content type

Image

Digest

sha256:08c637c44…

Size

38.6 MB

Last updated

over 3 years ago

docker pull chopin2712/flarum