Added experimental Docker instructions
This commit is contained in:
parent
36d63e0240
commit
a753918432
40
.dockerignore
Normal file
40
.dockerignore
Normal file
@ -0,0 +1,40 @@
|
||||
# Include any files or directories that you don't want to be copied to your
|
||||
# container here (e.g., local build artifacts, temporary files, etc.).
|
||||
#
|
||||
# For more help, visit the .dockerignore file reference guide at
|
||||
# https://docs.docker.com/go/build-context-dockerignore/
|
||||
|
||||
**/.DS_Store
|
||||
**/__pycache__
|
||||
**/.venv
|
||||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/compose.y*ml
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
||||
|
||||
config.json
|
||||
.renovaterc
|
||||
**/.idea
|
||||
**/.mypy_cache
|
||||
validation
|
27
Dockerfile
Normal file
27
Dockerfile
Normal file
@ -0,0 +1,27 @@
|
||||
ARG PYTHON_VERSION=3.12.8
|
||||
FROM python:${PYTHON_VERSION}-slim AS base
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ARG UID=10001
|
||||
RUN adduser \
|
||||
--disabled-password \
|
||||
--gecos "" \
|
||||
--home "/nonexistent" \
|
||||
--shell "/sbin/nologin" \
|
||||
--no-create-home \
|
||||
--uid "${UID}" \
|
||||
appuser
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
--mount=type=bind,source=requirements.txt,target=requirements.txt \
|
||||
python -m pip install -r requirements.txt
|
||||
|
||||
USER appuser
|
||||
|
||||
COPY . .
|
||||
|
||||
ENTRYPOINT ["python", "main.py"]
|
51
README.md
51
README.md
@ -7,14 +7,32 @@
|
||||
<a href="https://git.end-play.xyz/HoloUA/Discord"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
|
||||
</p>
|
||||
|
||||
## Installation
|
||||
## Installation from release
|
||||
|
||||
1. Install MongoDB using the [official installation manual](https://www.mongodb.com/docs/manual/installation/).
|
||||
2. `git clone https://git.end-play.xyz/HoloUA/Discord.git`
|
||||
3. `cd Discord`
|
||||
4. Install Python 3.9+ (at least 3.11 is recommended) for your OS
|
||||
5. `python3 -m pip install -r requirements.txt`
|
||||
6. Run it with `python3 main.py` after configuring
|
||||
1. Install MongoDB using the [official installation manual](https://www.mongodb.com/docs/manual/installation)
|
||||
2. Install Python 3.9+ (3.11+ is recommended)
|
||||
3. Download the [latest release](https://git.end-play.xyz/HoloUA/Discord/releases/latest)'s archive
|
||||
4. Extract the archive
|
||||
5. Navigate to the extracted folder and subfolder `Discord` in it
|
||||
6. Create a virtual environment:
|
||||
`python -m venv .venv` or `virtualenv .venv`
|
||||
7. Activate the virtual environment:
|
||||
Windows: `.venv\Scripts\activate.bat`
|
||||
Linux/macOS: `.venv/bin/activate`
|
||||
8. Install dependencies:
|
||||
`python -m pip install -r requirements.txt`
|
||||
9. Run the bot with `python main.py` after completing the [configuration](#Configuration)
|
||||
|
||||
## Installation with Git
|
||||
|
||||
1. Install MongoDB using the [official installation manual](https://www.mongodb.com/docs/manual/installation)
|
||||
2. Install Python 3.9+ (3.11+ is recommended)
|
||||
3. Clone the repository:
|
||||
`git clone https://git.end-play.xyz/HoloUA/Discord.git`
|
||||
4. `cd Discord`
|
||||
5. Install dependencies:
|
||||
`python -m pip install -r requirements.txt`
|
||||
6. Run the bot with `python main.py` after completing the [configuration](#Configuration)
|
||||
|
||||
## Configuration
|
||||
|
||||
@ -36,3 +54,22 @@ Mandatory keys to modify:
|
||||
- roles.*
|
||||
|
||||
After all of that you're good to go! Happy using :)
|
||||
|
||||
## Docker [Experimental]
|
||||
|
||||
As an experiment, Docker deployment option has been added.
|
||||
|
||||
### Building the image
|
||||
|
||||
1. `git clone https://git.end-play.xyz/HoloUA/Discord.git`
|
||||
2. `cd Discord`
|
||||
3. `docker build -t holoua-discord .`
|
||||
|
||||
### Starting the bot
|
||||
|
||||
1. Install MongoDB using the [official installation manual](https://www.mongodb.com/docs/manual/installation)
|
||||
2. Download
|
||||
the [configuration example file](https://git.end-play.xyz/HoloUA/Discord/src/branch/main/config_example.json) and
|
||||
store it somewhere you would like your bot to access it
|
||||
3. Complete the [configuration](#Configuration) step for this file
|
||||
4. `docker run -d -v /path/to/config.json:/app/config.json holoua-discord`
|
Loading…
Reference in New Issue
Block a user