Skip to content

Commit

Permalink
Merge pull request #1106 from Websoft9/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
chendelin1982 authored Dec 27, 2024
2 parents 1af9c22 + c25ae27 commit f38f04b
Show file tree
Hide file tree
Showing 19 changed files with 343 additions and 54 deletions.
59 changes: 48 additions & 11 deletions .github/ISSUE_TEMPLATE/compose_create.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,62 @@
---
name: New docker compose request
about: Create new docker-compose this project
title: 'complete docker-compose.yml for [appname]'
title: 'Create docker-compose.yml project for [appname]'
labels: 'feature'
assignees: ''
---

**What type of your feature request?**
## Describe application with below format

```
# application name
name: "Websoft9"
# URL of the software project's homepage
website_url: "https://www.websoft9.com"
# URL where the full source code of the program can be downloaded
source_code_url: "https://gitlab.com/websoft9/websoft9"
# a brief and concise statementthat presents the main points for this application, shorter than 10 characters
summary: "Open source Application self-hosting platform"
# description of what the software does, shorter than 250 characters, sentence case
description: "GitOps-driven, multi-application hosting for cloud servers and home servers, one-click deployment of 200+ open source apps."
# list of license identifiers, see https://opensource.org/licenses for the full list of licenses
licenses:
- LGPL-3.0
# (optional, true/false, default true) whether this application have Docker image
Docker_image: true
# (optional) link to an interactive demo of the software
demo_url: "https://www.websoft9.com/demo"
```

## Assessment Checklist by repository owner

Before deveopment, repository owner should complete below Assessment:

- [ ] This application have **3** containers
- [ ] official architecture research
- [ ] Complete the Contentful data for
- [ ] Create app project structure from template


## Development Checklist by deveoper

Developer should develop this application's docker compose project at **Websoft9 Console** directly.

- [ ] official architecture research
- [ ] test offcial docker
- [ ] complete standardized expression
- [ ] developer test and running
- [ ] follow [standardized syntax](https://github.com/Websoft9/docker-library/blob/main/docs/code_owner.md)
- [ ] specials and refers at notes.md/.env/docker-compose.yml
- [ ] contentful
- [ ] test at Appstore and nginx proxy testing
- [ ] docs
- [ ] siteurl or baseurl
- [ ] more environments from or configuration file
- [ ] test at Websoft9 Appstore and nginx proxy testing
- [ ] check siteurl or baseurl
- [ ] add official environments reference at .env
- [ ] connetion URI
- [ ] ports
- [ ] credentials environment
- [ ] i18n
- [ ] other
- [ ] commit RP to dev branch

## Production preparation by repository owner

- [ ] system test
- [ ] docs
- [ ] add Notes content to docs
- [ ] publish to RC release
44 changes: 30 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,29 @@

From opening a bug report to creating a pull request: every contribution is appreciated and welcome.

If you're planning to implement a new feature or change the docker-library repository, please [create an issue](https://github.com/websoft9/docker-library/issues/new/choose) first. This way we can ensure that your precious work is not in vain.

## Process
If you're planning to implement a new feature or change this repository, please [create an issue](https://github.com/websoft9/docker-library/issues/new/choose) first. This way we can ensure that your precious work is not in vain.

## Quick start for contributing new application

Below is the steps for contributing new application:

1. Create issue by template **New docker compose request**
2. Waiting for Maintainers/owner Assessment until it is completed.
3. Install Websoft9 at your server or apply online development account from Websoft9
4. SSH to develoment host machine and running below command
```
docker exec -it websoft9-apphub bash /websoft9/script/update_zip.sh --channel dev --package_name "media-dev.zip" --sync_to "/websoft9/media" && docker exec -it websoft9-apphub bash /websoft9/script/update_zip.sh --channel dev --package_name "library-dev.zip" --sync_to "/websoft9/library"
```
5. Login to Websoft9 Console and install this application from **App Store**
6. Develop and test it by **[App compose](https://support.websoft9.com/en/docs/next/app-compose/)** at Websoft9 Console
7. Complete your issue checklist
8. Docker exec **websoft9-apphub** container and pull request to repository
```
# sample for your, --appid get from Websoft9 Console, it not appname
docker exec -it websoft9-apphub apphub commit --appid "wordpress_o2qjz" --github_token "yourgithubtoken"
```

## Process diagram

[Bug report flow](https://www.canva.cn/design/DAFrBuGNCNs/-WGd-D0mQHBu1eZM07d8vQ/edit) as following:

Expand All @@ -14,30 +34,26 @@ If you're planning to implement a new feature or change the docker-library repos

![Alt text](./docs/image/feature_request_flow.png)

## Development
## Development Specification

If you want to start to develop this repository, it is very useful for you to read [the develop documentation](docs/code_owner.md)

## Fork

Contributor only allow to fork [main branch](https://github.com/Websoft9/docker-library/tree/main) and pull request for it. Maintainers don't accept any pr to **production branch**

## Branch

This repository have these branchs:

- **Contributor's branch**: Develpoer can fork main branch as their delelopment branch anytime
- **main branch**: The only branch that accepts PR from Contributors's branch
- **dev branch**: Contributor only allow to fork [dev branch](https://github.com/Websoft9/docker-library/tree/dev) and pull request for it.
- **main branch**: It is expected to contain code that is stable and ready for deployment.

Flow: Contributor's branch → main branch
> Maintainers/owner don't accept any pr to **main branch** from developer directly.
## Pull request

[Pull request](https://docs.github.com/pull-requests) let you tell others about changes you've pushed to a branch in a repository on GitHub.

#### When is PR produced?

- Contributor commit to main branch
- Contributor commit to dev branch

#### How to deal with PR?

Expand All @@ -63,8 +79,8 @@ Websoft9 use below [Artifact](https://jfrog.com/devops-tools/article/what-is-a-s

### Tags

- Type tags: Bug, enhancement, Documetation
- Stages Tags: PRD, Dev, QA(include deployment), Documentation
- Type tags: RRD, Bug, enhancement, Documetation
- Stages Tags: S-develop, S-fixed and all tags started with `S-`

### WorkFlow

Expand Down
31 changes: 4 additions & 27 deletions add_apps.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,14 @@
[
{
"name": "aaaa1111",
"trademark": "aaaa111",
"name": "neko",
"trademark": "Neko",
"release": false,
"fork_url": "https://github.com/ONLYOFFICE/docker#recommended-system-requirements",
"version_from": "",
"fork_url": "https://github.com/m1k1o/neko",
"version_from": "https://hub.docker.com/r/elestio/neko/tags",
"edition": [
{
"dist": "community",
"version": [
"1.0",
"latest"
]
}
],
"requirements": {
"cpu": "2",
"memory": "4",
"disk": "1",
"url": "https://github.com/onlyoffice/docker#recommended-system-requirements"
}
},
{
"name": "aaaa2222",
"trademark": "aaaa222",
"release": false,
"fork_url": "https://github.com/ONLYOFFICE/docker#recommended-system-requirements",
"version_from": "",
"edition": [
{
"dist": "community",
"version": [
"1.2",
"latest"
]
}
Expand Down
48 changes: 48 additions & 0 deletions apps/neko/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
W9_REPO=wordpress
W9_DIST=community
W9_VERSION=latest

W9_POWER_PASSWORD=1PrMxExC45LsCT

# Environments which for user settings when create application
# Named expression: W9_xxx_xxx_SET, xxx refer to file fields
W9_HTTP_PORT_SET=9001
W9_HTTPS_PORT_SET=9002
W9_DB_PORT_SET=3306
W9_SSH_PORT_SET=23
W9_KEY_SET="dfsjdkjf77xjxcjcj"

#### -- Not allowed to edit below environments when recreate app based on existing data -- ####

W9_ID=neko

# W9_HTTP_PORT or W9_HTTPS_PORT is need at leaset and used for proxy for web application
# Some container (e.g teleport) need HTTPS access, then need to set this pra
W9_HTTP_PORT=80
W9_HTTPS_PORT=81

W9_LOGIN_USER=admin
# use https://1password.com/zh-cn/password-generator/ to genarate 14 bit password
# this password can also use password file
W9_LOGIN_PASSWORD=$W9_POWER_PASSWORD
W9_ADMIN_PATH="/wp-login"

# Container name's suffix must use one of the value
W9_DB_EXPOSE="mysql,postgresql,mariadb,mongodb,redis"

# It is used when the application APP needs to set an external URL, which can be IP(or domain), IP:PORT, http(s)://IP:PORT
W9_URL=internet_ip:$W9_HTTP_PORT
# modifies W9_URL on init when it is true
W9_URL_REPLACE=true

W9_URL_WITH_PORT=false

W9_NETWORK=websoft9

#### ----------------------------------------------------------------------------------------- ####


# Below environment is created by apphub

#W9_NAME=""
#W9_RCODE=""
5 changes: 5 additions & 0 deletions apps/neko/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CHANGELOG

## Release
### Fixes and Enhancements

21 changes: 21 additions & 0 deletions apps/neko/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# image: https://hub.docker.com/r/websoft9dev/discuzq

FROM ccr.ccs.tencentyun.com/discuzq/dzq:latest

LABEL org.opencontainers.image.authors="https://www.websoft9.com" \
org.opencontainers.image.description="Application packaged by Websoft9" \
org.opencontainers.image.source="https://github.com/Websoft9/docker-library/tree/main/apps/opencart" \
org.opencontainers.image.title="OpenCart" \
org.opencontainers.image.vendor="Websoft9 Inc." \
org.opencontainers.image.version="4.0.1.1"

ENV DISCUZQ_MYSQL_HOST=mysql
ENV DISCUZQ_MYSQL_USER=discuzq
ENV DISCUZQ_MYSQL_PASSWORD=discuzq
ENV DISCUZQ_MYSQL_DATABASE=discuzq
ENV DISCUZQ_SITENAME=DiscuzQ

COPY cmd.sh /tmp
RUN chmod +x /tmp/cmd.sh

CMD ["/tmp/cmd.sh"]
2 changes: 2 additions & 0 deletions apps/neko/Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Appname
## FAQ
26 changes: 26 additions & 0 deletions apps/neko/README.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# {{trademark}} on Docker

This is an **Docker Compose solution** powered by [Websoft9](https://www.websoft9.com) based on Docker for {{trademark}}:

{% for ed in edition %}
- {{ed.dist}}: {{ ed.version | join(', ') }}
{% endfor %}

## System Requirements

The following are the minimal [recommended requirements]({{requirements.url}}):

* **RAM**: {{requirements.memory}} GB or more
* **CPU**: {{requirements.cpu}} cores or higher
* **Disk**: at least {{requirements.disk}} GB of free space
* **bandwidth**: more fluent experience over 100M

## Install

You can install this {{trademark}} by [How to use it?](https://github.com/Websoft9/docker-library#how-to-use-it).

If you want use {{trademark}} with **Websoft9 Business Support** free, you can [subscribe {{trademark}}](https://www.websoft9.com/apps) on Cloud platform

## Documentation

[{{trademark}} Administrator Guide](https://support.websoft9.com/docs/{{name}}) powered by Websoft9
52 changes: 52 additions & 0 deletions apps/neko/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# image,docs: https://hub.docker.com/_/wordpress/

version: '3.8'

services:

wordpress:
image: $W9_REPO:$W9_VERSION
container_name: $W9_ID
restart: unless-stopped
#This is for access host from container
# extra_hosts: ["host.docker.internal:host-gateway"]
# command: |
# /bin/bash -c "ping -c 3 host.docker.internal"
logging:
driver: "json-file"
options:
max-file: "5"
max-size: 10m
deploy:
resources:
limits:
memory: 5g
cpus: '0.7'
ports:
- $W9_HTTP_PORT_SET:80
env_file: .env
volumes:
- wordpress:/var/www/html
- ./src/php_exra.ini:/usr/local/etc/php/conf.d/php_exra.ini

mariadb:
image: mariadb:10.4
container_name: $W9_ID-mariadb
restart: unless-stopped
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --innodb_log_buffer_size=30M
volumes:
- mysql_data:/var/lib/mysql
environment:
MYSQL_DATABASE: $W9_ID
MYSQL_USER: $W9_ID
MYSQL_PASSWORD: $W9_POWER_PASSWORD
MYSQL_ROOT_PASSWORD: $W9_POWER_PASSWORD

volumes:
wordpress:
mysql_data:

networks:
default:
name: $W9_NETWORK
external: true
3 changes: 3 additions & 0 deletions apps/neko/src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# About

This folder includes files mount to container and used by Websoft9
1 change: 1 addition & 0 deletions apps/neko/src/after_up.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

12 changes: 12 additions & 0 deletions apps/neko/src/encrypt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
clear



# Add encrypt script below if use W9_ENCRYPT_PASSWORD at .env file
# ------------- start -------------------------



# ------------- end ---------------------------
3 changes: 3 additions & 0 deletions apps/neko/src/filelist
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker-compose.yml
script/test.sh
docker
1 change: 1 addition & 0 deletions apps/neko/src/get_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading

0 comments on commit f38f04b

Please sign in to comment.