Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add container files #328

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vendor/**
logs/**/*.log
src/settings-local.php
src/settings-local.php
container/docker-compose.yml
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,41 @@ cp src/settings-local-example.php src/settings-local.php

Now you should proceed to update `src/settings-local.php` with your DB password and session secret.

## Container

It is also possible to run the asset library inside a container (e.g. with Docker).

First create a new settings file for the website.

```bash
cp src/settings-local-example.php src/settings-local.php
```

Update `src/settings-local.php` with your DB password and session secret.

Now continue from the `container` directory and create your own `docker-compose.yml` file.

```bash
cd container
cp docker-compose.example.yml docker-compose.yml
```

Adjust user and password inside the created `docker-compose.yml`.

Now build the container image

```bash
docker compose build
```

To run the whole composition

```bash
docker compose up -d
```

The website is now available at http://localhost:8080/asset-library.

## Browser support

When working on new features, keep in mind this website only supports
Expand Down
14 changes: 14 additions & 0 deletions container/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM php:7.4-apache

RUN apt-get update && apt-get install -y git zip \
&& docker-php-ext-install mysqli pdo pdo_mysql
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer


COPY . /var/www/html/asset-library

WORKDIR /var/www/html/asset-library
RUN composer install \
&& a2enmod rewrite \
&& chown -R www-data:www-data .
USER www-data
20 changes: 20 additions & 0 deletions container/docker-compose.example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
services:
gd-asset-library:
build:
context: ../
dockerfile: ./container/Dockerfile
depends_on:
- database
ports:
- 8080:80
database:
image: mariadb:11.3.2
volumes:
- ../data:/docker-entrypoint-initdb.d:ro
expose:
- 3306
environment:
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_DATABASE: asset-library
MARIADB_ROOT_PASSWORD: root_password