Compare commits

..

No commits in common. "master" and "v2.7" have entirely different histories.
master ... v2.7

4 changed files with 51 additions and 26 deletions

10
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"

View File

@ -39,6 +39,7 @@ jobs:
context: .
platforms: |
linux/amd64
linux/arm64
tags: |
${{env.VERSION_TAG}}
${{env.LASTEST_TAG}}

17
.github/workflows/linter.yml vendored Normal file
View File

@ -0,0 +1,17 @@
---
name: Lint Code Base
on: push
jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Lint Code Base
uses: docker://github/super-linter:v2.2.2
env:
VALIDATE_ENV: false

View File

@ -1,44 +1,41 @@
FROM elixir:1.16.3-alpine
FROM elixir:1.14-alpine
ARG PLEROMA_VER=stable
ARG PLEROMA_VER=develop
ARG UID=911
ARG GID=911
ENV MIX_ENV=prod
# 更新并安装必要的依赖
RUN apk update && \
apk add --no-cache \
git gcc g++ musl-dev make cmake file-dev \
exiftool imagemagick libmagic ncurses \
postgresql-client ffmpeg openssl-dev
RUN echo "http://nl.alpinelinux.org/alpine/latest-stable/main" >> /etc/apk/repositories \
&& apk update \
&& apk upgrade \
&& apk add git gcc g++ musl-dev make cmake file-dev \
exiftool imagemagick libmagic ncurses postgresql-client ffmpeg
# 创建用户和组
RUN addgroup -g ${GID} pleroma && \
adduser -h /pleroma -s /bin/false -D -G pleroma -u ${UID} pleroma
RUN addgroup -g ${GID} pleroma \
&& adduser -h /pleroma -s /bin/false -D -G pleroma -u ${UID} pleroma
# 创建必要的目录并设置权限
ARG DATA=/var/lib/pleroma
RUN mkdir -p /etc/pleroma ${DATA}/uploads ${DATA}/static && \
chown -R pleroma:pleroma /etc/pleroma ${DATA}
RUN mkdir -p /etc/pleroma \
&& chown -R pleroma /etc/pleroma \
&& mkdir -p ${DATA}/uploads \
&& mkdir -p ${DATA}/static \
&& chown -R pleroma ${DATA}
# 切换到 pleroma 用户
USER pleroma
WORKDIR /pleroma
# 克隆 Pleroma 仓库并切换到指定版本
RUN git clone -b stable https://git.pleroma.social/pleroma/pleroma.git . && \
git checkout ${PLEROMA_VER} && \
echo "import Mix.Config" > config/prod.secret.exs && \
mix local.hex --force && \
mix local.rebar --force && \
mix deps.get --only prod && \
mix release --path /pleroma
RUN git clone -b develop https://git.pleroma.social/pleroma/pleroma.git /pleroma \
&& git checkout ${PLEROMA_VER}
RUN echo "import Mix.Config" > config/prod.secret.exs \
&& mix local.hex --force \
&& mix local.rebar --force \
&& mix deps.get --only prod \
&& mkdir release \
&& mix release --path /pleroma
# 复制配置文件
COPY ./config.exs /etc/pleroma/config.exs
# 暴露端口
EXPOSE 4000
# 设置入口点
ENTRYPOINT ["/pleroma/docker-entrypoint.sh"]