forked from modmail-dev/Modmail
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
2,133 additions
and
1,319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
TOKEN=MyBotToken | ||
LOG_URL=https://logviewername.herokuapp.com/ | ||
GUILD_ID=1234567890 | ||
MODMAIL_GUILD_ID=1234567890 | ||
OWNERS=Owner1ID,Owner2ID,Owner3ID | ||
CONNECTION_URI=mongodb+srv://mongodburi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
version: "1" | ||
rules: | ||
- base: master | ||
upstream: kyb3r:master | ||
upstream: modmail-dev:master | ||
mergeMethod: hardreset | ||
- base: development | ||
upstream: kyb3r:development | ||
upstream: modmail-dev:development | ||
mergeMethod: hardreset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
name: Create and publish a Docker image | ||
|
||
on: | ||
push: | ||
branches: ['master'] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,32 @@ | ||
FROM python:3.10-alpine as py | ||
FROM python:3.11-alpine as py | ||
|
||
FROM py as build | ||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y \ | ||
# Install CairoSVG dependencies. | ||
libcairo2 && \ | ||
# Cleanup APT. | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
# Create a non-root user. | ||
useradd --shell /usr/sbin/nologin --create-home -d /opt/modmail modmail | ||
|
||
RUN apk add --no-cache build-base libffi-dev | ||
COPY requirements.txt / | ||
RUN pip install --prefix=/inst -U -r /requirements.txt | ||
|
||
FROM py | ||
COPY requirements.txt . | ||
|
||
RUN apk add --no-cache cairo | ||
|
||
ENV USING_DOCKER yes | ||
ENV PYTHONUNBUFFERED=1 \ | ||
PYTHONDONTWRITEBYTECODE=1 \ | ||
USING_DOCKER=yes | ||
|
||
COPY --from=build /inst /usr/local | ||
|
||
WORKDIR /modmailbot | ||
COPY . /modmailbot | ||
|
||
COPY ./entrypoint.sh / | ||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
CMD ["python", "bot.py"] | ||
CMD ["python", "bot.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.