naala89/apiopenstudio
Production ready image of ApiOpenStudio
163
This image provides a docker image for production use ApiOpenStudio.
It contains:
This container contains a full working Nginx/PHP server and ApiOpenStudio. It requires a separate MariaDB container, and can be quickly installed on a bare-bones production server in minutes to have a fully functioning ApiOpenStudio instance.
Note: There should not be a running instance of Apache or Nginx on the server, otherwise the incoming port 80/443 requests will not get directed to the Docker container.
In order to run this container you'll need docker installed.
/etc/nginx/nginx.conf
- The main Nginx config file./etc/nginx/sites-enabled/default
- The Nginx site config file./etc/php/8.1/{cli,fpm}/php.ini
- PHP configuration./var/www/html/install.sh
- Install composer, npm and gulp dependencies.Create the database volume
sudo docker volume create dbdata
Create the Docker network
sudo docker network create api_network
Start the database container
sudo docker run -d --name=apiopenstudio-db \
-e MYSQL_DATABASE=apiopenstudio \
-e MYSQL_USER=apiopenstudio \
-e MYSQL_PASSWORD=my_s3cr3t \
-e MYSQL_ROOT_PASSWORD=my_s3cr3t \
-h apiopenstudio-db \
-v dbdata:/var/lib/mysql \
--restart=unless-stopped \
--network=api_network \
mariadb:latest
Download the settings file.
sudo mkdir -p /data/apiopenstudio
sudo curl https://raw.githubusercontent.com/naala89/apiopenstudio/master/example.docker.settings.yml -o /data/apiopenstudio/settings.yml
Required updated settings.yml changes
* db.root_password
* db.username
* db.password
* api.url
* api.jwt_issuer
* api.jwt_permitted_for
Start the API container Replace the following with the correct values:
sudo docker run -d --name apiopenstudio-api \
-p 80:80 \
-p 443:443 \
--mount type=bind,source=/data/apiopenstudio/settings.yml,target=/var/www/html/settings.yml \
--mount type=bind,source=/path/to/ssl.crt,target=/etc/nginx/certs/apiopenstudio.crt \
--mount type=bind,source=/path/to/ssl.key,target=/etc/nginx/certs/apiopenstudio.key \
--network=api_network \
--restart=unless-stopped \
naala89/apiopenstudio:tag
SSH into the API container
sudo docker exec -it apiopenstudio-api bash
Install composer dependencies and database.
./install.sh
Visit the ApiOpenStudio wiki for full instructions and configuration of
settings.yml
This image automatically built from tags on the master branch at GitLab.
Version tags (i.e. naala89/apiopenstudio:1.0
) references the version of the
image and the tag of the release.
Version tags of master
& develop
(i.e. naala89/apiopenstudio:master
)
references the latest version on the branch.
The latest
tag is most recent built image and should not be used to pull the
latest tagged version.
CI/CD
Variables:CI_REPOSITORY
- The path to the repository to build from,
i.e. https://gitlab.com/naala89/apiopenstudio
SSH_PRIVATE_KEY
- Any valid SSH private keyCI_REGISTRY
- docker.io
CI_IMAGE_NAME
- The name of the image to be uploaded to docker,
i.e. apiopenstudio
CI_REGISTRY_USER
- Docker Hub usernameCI_REGISTRY_PASSWORD
- Docker Hub passwordRun pipeline
Run for branch name or tag
: Select master
(this is the branch to run the build pipelines from)BRANCH
- Branch nameTAG
- Tag name.env
Add a .env
file to your clone of this repo. Contents:
CI_REGISTRY=docker.io
CI_REPOSITORY=https://gitlab.com/<user_name>/<repo_name>
CI_IMAGE_NAME=apiopenstudio
CI_REGISTRY_USER=<docker_username>
CI_REGISTRY_PASSWORD=<docker_password>
# Upload an image of branch_name
./upload.sh -b branch_name
# Upload an image of tag_name
./upload.sh -t tag_name
You must declare either -b
or -t
parameters, to specify what version of
ApiOpenStudio Admin to publish and tag.
All other parameters are optional and will override the .env
file.
-b
Repository branch-t
Repository tag-r
Repository URL-i
Docker Hub Image name-u
Docker user name-p
Docker user password-h
Command helpThis project is licensed under the MIT License - see the LICENSE.md file for details.
docker pull naala89/apiopenstudio