Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
icyleaf committed Jun 9, 2022
2 parents 306e585 + 793102e commit 75c7b92
Show file tree
Hide file tree
Showing 132 changed files with 2,263 additions and 2,036 deletions.
45 changes: 45 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.1, 3.0, 2, 2.7, 2.6, 3-bullseye, 3.1-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 2.6-bullseye, 3-buster, 3.1-buster, 3.0-buster, 2-buster, 2.7-buster, 2.6-buster
ARG VARIANT=3.0-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT}

# Update args in docker-compose.yaml to set the UID/GID of the "vscode" user.
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
groupmod --gid $USER_GID vscode \
&& usermod --uid $USER_UID --gid $USER_GID vscode \
&& chmod -R $USER_UID:$USER_GID /home/vscode; \
fi

# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# tmux is for overmind
# TODO : install foreman in future
# packages: postgresql-server-dev-all
# may be postgres in same machine

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
libssl-dev \
tar \
tzdata \
postgresql-client \
yarn \
git \
imagemagick \
libjpeg-dev libpng-dev libtiff-dev libwebp-dev \
tmux \
zsh

WORKDIR /workspace
COPY . /workspace

COPY Gemfile Gemfile.lock ./
RUN gem install bundler
RUN bundle install

COPY package.json yarn.lock ./
RUN yarn install
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "Zealot Development Codespace",
// "build": {
// "dockerfile": "Dockerfile",
// },

// docker-compose
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",

// "settings": {
// "terminal.integrated.shell.linux": "/bin/zsh"
// },

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"rebornix.Ruby"
// "misogi.ruby-rubocop",
// "wingrunr21.vscode-ruby"
],


// TODO: figure whether we can get all this ports work properly

// 3000 rails
// 3035 webpacker
// 5432 postgres
// 6379 redis
// 1025,8025 mailhog
// "forwardPorts": [5432, 6379, 1025, 8025],
//your application may need to listen on all interfaces (0.0.0.0) not just localhost for it to be available externally. Defaults to []
// "appPort": [3001],

// Use 'postCreateCommand' to run commands after the container is created.
// #TODO: can we move logic of copy env file into dockerfile ?
// "postCreateCommand": "cp .env.example .env",
}
50 changes: 50 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# https://github.com/microsoft/vscode-dev-containers/blob/master/containers/python-3-postgres/.devcontainer/docker-compose.yml
# https://github.com/microsoft/vscode-dev-containers/blob/master/containers/ruby-rails/.devcontainer/devcontainer.json

version: '3'

services:
app:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
args:
# [Choice] Install Node.js
INSTALL_NODE: "true"
NODE_VERSION: "lts/*"
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
USER_UID: 1000
USER_GID: 1000

volumes:
- ..:/workspace:cached

# # Overrides default command so things don't shut down after the process ends.
# command: sleep infinity

# ports:
# - 3001:3000

# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db

db:
image: postgres:11-alpine
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres

redis:
image: redis:6.0.9-alpine
restart: unless-stopped
network_mode: service:db
volumes:
- redis-data:/data

volumes:
postgres-data:
redis-data:
61 changes: 61 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: 问题反馈 | Bug report
description: 提交使用过程发现的缺陷 | Report a potential bug
body:
- type: markdown
attributes:
value: |
**请务必保证提出的问题已经仔细阅读了[部署](https://zealot.ews.im/#/deployment)和[参数配置](https://zealot.ews.im/#/configuration)文档,否则不予提供技术帮助 !!!**
为了更好的发现问题,请认真填写下面的选项,感谢您付出的时间!
Thanks for taking the time to fill out this bug report!
- type: dropdown
id: deploy
attributes:
label: 部署方式 | How to Deploy
description: 使用的方式部署的 | What way of zealot are you deploying?
options:
- 使用一键部署脚本 | Using zealot-docker on-click install (Default)
- Docker (Default)
- 源码部署 | Source
validations:
required: true
- type: dropdown
id: version
attributes:
label: 部署版本 | Version
description: 使用的 Docker 的什么版本? | What version of docker image tag are you running?
options:
- nightly (Default)
- stable
- latest
- 其他 | other
validations:
required: true
- type: input
id: reverse_proxy
attributes:
label: 反代服务 | Reverse Proxy
description: 是否使用了反代服务 | Which reverse proxy service do you using?
placeholder: nginx/haproxy/caddy/traefik/none
validations:
required: true
- type: checkboxes
id: document
attributes:
label: 已阅读文档 | Read the document
description: 提交本问题标识你已经阅读部署和配置文档 | By submitting this issue, you read our [deployment and configuration](https://zealot.ews.im)
options:
- label: 已阅读 | Yes
required: true
- type: textarea
attributes:
label: 描述 | Description
description: 请描述你的问题 | Please describe your bug
- type: textarea
id: logs
attributes:
label: 问题日志 | Relevant log output
description: |
请直接复制粘贴终端的运行日志,代码格式会自动格式化
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: 问题提问 | Ask a question (GitHub Discussions)
url: https://github.com/tryzealot/zealot/discussions
about: 所有问题会放在 GitHub Discussions,GitHub issues 仅提供缺陷追踪和新特性相关,但我保留不回答的权利 | We use GitHub Discussions for questions, GitHub issues for tracking bug reports and feature requests
- name: 私下技术沟通 | Chat with developer
url: https://github.com/tryzealot/zealot
about: 别想了!就算你找到我了,我也不会给予任何回复!开发者会在在本页面上述反馈方式进行回复 | No way!
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: 新特性 | Feature request
description: 期望开发新功能、新特性 | Request a feature
body:
- type: textarea
attributes:
label: 描述 | Description
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ bundler/
storage/

# minimal Rails specific artifacts
/config/master.key
/config/credentials.yml*
db/*.sqlite3
/db/*.sqlite3-journal
/log/*
Expand Down Expand Up @@ -68,3 +70,10 @@ yarn-debug.log*
.powenv
.rvmrc
.byebug_history

/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ AllCops:
- 'node_modules/**/*'
- 'tmp/**/*'
- 'bin/**/*'
- "db/**/*"
- 'db/**/*'
- 'lib/omni_auth/**/*'
CacheRootDirectory: tmp

Style/FrozenStringLiteralComment:
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.7-alpine as builder
FROM ruby:3.0-alpine as builder

ARG BUILD_PACKAGES="build-base libxml2 libxslt git"
ARG DEV_PACKAGES="libxml2-dev libxslt-dev yaml-dev postgresql-dev nodejs npm yarn libwebp-dev libpng-dev tiff-dev"
Expand Down Expand Up @@ -48,20 +48,20 @@ RUN SECRET_TOKEN=precompile_placeholder bin/rails assets:precompile
# Remove folders not needed in resulting image
RUN rm -rf docker node_modules tmp/cache spec .browserslistrc babel.config.js \
package.json postcss.config.js yarn.lock && \
cd /app/vendor/bundle/ruby/2.7.0 && \
cd /app/vendor/bundle/ruby/3.0.0 && \
rm -rf cache/*.gem && \
find gems/ -name "*.c" -delete && \
find gems/ -name "*.o" -delete

##################################################################################

FROM ruby:2.7-alpine
FROM ruby:3.0-alpine

ARG BUILD_DATE
ARG VCS_REF
ARG TAG

ARG ZEALOT_VERSION="4.3.1"
ARG ZEALOT_VERSION="4.4.0"
ARG REPLACE_CHINA_MIRROR="true"
ARG ORIGINAL_REPO_URL="dl-cdn.alpinelinux.org"
ARG MIRROR_REPO_URL="mirrors.ustc.edu.cn"
Expand Down
Loading

0 comments on commit 75c7b92

Please sign in to comment.