Docker support for local development
This commit is contained in:
parent
8edd975b11
commit
c378019deb
9
docker/development/Dockerfile
Normal file
9
docker/development/Dockerfile
Normal file
|
@ -0,0 +1,9 @@
|
|||
FROM php:7.4-apache
|
||||
RUN apt update && apt install -y \
|
||||
ssl-cert \
|
||||
libicu-dev \
|
||||
libjpeg-dev zlib1g-dev libpng-dev libwebp-dev
|
||||
RUN docker-php-ext-configure gd --with-jpeg --with-webp
|
||||
RUN docker-php-ext-install bcmath exif gettext gd intl mysqli
|
||||
RUN a2enmod rewrite ssl
|
||||
RUN a2ensite default-ssl
|
32
docker/development/README.md
Normal file
32
docker/development/README.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# Docker for development
|
||||
|
||||
This directory has docker related files for local development.
|
||||
|
||||
You can run GNU social on Docker by following commands on your local machine.
|
||||
|
||||
```
|
||||
cd /path/to/repository
|
||||
mkdir -p file/avatar
|
||||
cp DOCUMENTATION/SYSTEM_ADMINISTRATORS/webserver_conf/htaccess.sample public/.htaccess
|
||||
|
||||
cd docker/development
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
After commands, you can open <https://localhost/installer.php> on your web browser. If you use Chromium/Google Chrome, you need to open <chrome://flags/#allow-insecure-localhost> and turn to [Enabled] for security alert.
|
||||
|
||||
In installer, you need to fill following database settings.
|
||||
|
||||
- Hostname: db
|
||||
- Type: MariaDB
|
||||
- Name: gnusocial
|
||||
- DB username: root
|
||||
- DB password: (empty)
|
||||
|
||||
You can remove container and named volume by following commands.
|
||||
|
||||
```
|
||||
docker compose down
|
||||
docker volume rm development_gnusocial-db
|
||||
```
|
||||
|
26
docker/development/docker-compose.yml
Normal file
26
docker/development/docker-compose.yml
Normal file
|
@ -0,0 +1,26 @@
|
|||
version: "3"
|
||||
services:
|
||||
db:
|
||||
image: mariadb:10.3
|
||||
restart: always
|
||||
volumes:
|
||||
- gnusocial-db:/var/lib/mysql
|
||||
environment:
|
||||
MYSQL_DATABASE: gnusocial
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: 1
|
||||
ports:
|
||||
- 3306:3306
|
||||
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin
|
||||
php:
|
||||
build: .
|
||||
restart: always
|
||||
volumes:
|
||||
- ../../:/var/www/
|
||||
- ../../public:/var/www/html
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
depends_on:
|
||||
- db
|
||||
volumes:
|
||||
gnusocial-db:
|
Loading…
Reference in New Issue
Block a user