Compare commits

..

3 commits

Author SHA1 Message Date
mrilyew
17f2e5982e
Merge 628cdf1a63 into b557f42daa 2024-10-30 04:01:16 +05:00
b557f42daa
build: add additional compose file for devs 2024-10-29 22:11:06 +03:00
Jillian Österreich
250c022bde
docs(docker): improve instructions 2024-10-30 00:16:06 +07:00
2 changed files with 41 additions and 17 deletions

View file

@ -1,51 +1,55 @@
# Docker # Docker
Note: `buildx` is required for building multi-arch images. See [Docker Buildx](https://docs.docker.com/buildx/working-with-buildx/) for more information. Note: If you want to build images for multiple architectures, you must use `buildx`. See [Docker Buildx](https://docs.docker.com/buildx/working-with-buildx/) for more information.
If unsure, skip to single-arch image build instructions. If unsure, skip to single-arch image build instructions.
## Build ## Build
Note: commands below should be run from the root of the repository. Note: **commands below must be run from the this directory** (`/install/automated/docker/`).
### Multi-arch (arm64, amd64) ### Multi-arch (arm64, amd64)
Base images: Base images:
``` ```
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/php:8.2-cli . --load -f install/automated/docker/base-php-cli.Dockerfile docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/php:8.2-cli ../../.. --load -f base-php-cli.Dockerfile
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/php:8.2-apache . --load -f install/automated/docker/base-php-apache.Dockerfile docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/php:8.2-apache ../../.. --load -f base-php-apache.Dockerfile
``` ```
DB images: DB images:
``` ```
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/mariadb:10.9-primary . --load -f install/automated/docker/mariadb-primary.Dockerfile docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/mariadb:10.9-primary ../../.. --load -f mariadb-primary.Dockerfile
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/mariadb:10.9-eventdb . --load -f install/automated/docker/mariadb-eventdb.Dockerfile docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/mariadb:10.9-eventdb ../../.. --load -f mariadb-eventdb.Dockerfile
``` ```
OpenVK main image: OpenVK main image:
``` ```
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/openvk:latest . --load -f install/automated/docker/openvk.Dockerfile docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/openvk:latest ../../.. --load -f openvk.Dockerfile
``` ```
### Single-arch ### Single-arch
Base images: Base images:
``` ```
docker build -t ghcr.io/openvk/openvk/php:8.2-cli . -f install/automated/docker/base-php-cli.Dockerfile docker build -t ghcr.io/openvk/openvk/php:8.2-cli ../../.. -f base-php-cli.Dockerfile
docker build -t ghcr.io/openvk/openvk/php:8.2-apache . -f install/automated/docker/base-php-apache.Dockerfile docker build -t ghcr.io/openvk/openvk/php:8.2-apache ../../.. -f base-php-apache.Dockerfile
``` ```
DB images: DB images:
``` ```
docker build -t ghcr.io/openvk/openvk/mariadb:10.9-primary . -f install/automated/docker/mariadb-primary.Dockerfile docker build -t ghcr.io/openvk/openvk/mariadb:10.9-primary ../../.. -f mariadb-primary.Dockerfile
docker build -t ghcr.io/openvk/openvk/mariadb:10.9-eventdb . -f install/automated/docker/mariadb-eventdb.Dockerfile docker build -t ghcr.io/openvk/openvk/mariadb:10.9-eventdb ../../.. --f mariadb-eventdb.Dockerfile
``` ```
OpenVK main image: OpenVK main image:
``` ```
docker build -t ghcr.io/openvk/openvk/openvk:latest . -f install/automated/docker/openvk.Dockerfile docker build -t ghcr.io/openvk/openvk/openvk:latest ../../.. -f openvk.Dockerfile
``` ```
## Run ## Run
If you have Docker Desktop installed, then you probably have `docker-compose` installed as well. If not, refer to [Docker Compose](https://docs.docker.com/compose/install/) for installation instructions. If you have Docker Desktop installed, then you should have `docker compose` installed automatically. If not, refer to [Docker Compose](https://docs.docker.com/compose/install/) for installation instructions.
Before start, copy `openvk-example.yml` from the root of the repository to `openvk.yml` in this directory and edit it to your liking. Example configurations are located in this directory for convenience. Before start, copy `openvk.example.yml` to `openvk.yml`, then `chandler.example.yml` to `chandler.yml` and edit them to your liking.
Then, obtain `chandler-example.yml` from [chandler repository](https://github.com/openvk/chandler/blob/master/chandler-example.yml) and place it in this directory as well. Start is simple as `docker compose up -d`. You can also use `docker compose up` to see logs.
Start is simple as `docker-compose up -d`. You can also use `docker-compose up` to see logs.
- OpenVK will be available at `http://localhost:8080/`. - OpenVK will be available at `http://localhost:8080/`.
- PHPMyAdmin will be available at `http://localhost:8081/`. - PHPMyAdmin will be available at `http://localhost:8081/`.
- Adminer will be available at `http://localhost:8082/`. - Adminer will be available at `http://localhost:8082/`.
### Running in development environment
By using additional `docker-compose.dev.yml` file you can develop OpenVK in Docker with automatic updates as you edit and save your code. Simply run:
```
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --watch
```

View file

@ -0,0 +1,20 @@
services:
openvk:
build:
context: ../../..
dockerfile: install/automated/docker/openvk.Dockerfile
develop:
watch:
- path: ../../..
action: sync
target: /opt/chandler/extensions/available/openvk
ignore:
- vendor/
- path: ../../../composer.json
action: rebuild
- path: ../../../composer.lock
action: rebuild
- path: ../../../Web/static/js/package-lock.json
action: rebuild
- path: ../../../Web/static/js/package.json
action: rebuild