mirror of
https://github.com/TeamNewPipe/CrashReportImporter
synced 2025-10-06 00:22:39 +02:00
Set up Docker deployment
This commit is contained in:
10
.dockerignore
Normal file
10
.dockerignore
Normal file
@@ -0,0 +1,10 @@
|
||||
mail-credentials.txt
|
||||
*-dsn.txt
|
||||
*.stored.txt
|
||||
__pycache__/
|
||||
*.py[c|o]
|
||||
mails/
|
||||
.idea/
|
||||
*.tar*
|
||||
*.sh
|
||||
*venv*/
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -8,3 +8,5 @@ mails/
|
||||
*.tar*
|
||||
*.sh
|
||||
*venv*/
|
||||
docker-compose.yml*
|
||||
!docker-compose.yml.example
|
||||
|
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM python:3.9-alpine
|
||||
|
||||
# we want to run the server with an unprivileged user
|
||||
RUN adduser -S web
|
||||
|
||||
# install build dependencies
|
||||
RUN apk add --no-cache gcc g++ make musl-dev libffi-dev openssl-dev && \
|
||||
python3 -m pip install -U poetry
|
||||
|
||||
# set up mount for directory storage
|
||||
RUN install -o web -d /app/mails
|
||||
VOLUME /app/mails
|
||||
|
||||
WORKDIR /app/
|
||||
USER web
|
||||
|
||||
# setting up the port now, as it'll hardly ever change
|
||||
# doing this before the rest of the commands will speed up building the image a bit
|
||||
EXPOSE 8025
|
||||
|
||||
# the Python dependencies hardly ever change (and it takes quite some time), so we install them first
|
||||
# this way, we don't have to reinstall them when we only have some code changes
|
||||
COPY pyproject.toml poetry.lock /app/
|
||||
RUN poetry install
|
||||
|
||||
# next, we copy the source code
|
||||
COPY newpipe_crash_report_importer/ /app/newpipe_crash_report_importer/
|
||||
|
||||
# finally, configure the server command
|
||||
CMD poetry run python -m newpipe_crash_report_importer --force-colors=true serve --host 0.0.0.0 --port 8025
|
19
docker-compose.yml.example
Normal file
19
docker-compose.yml.example
Normal file
@@ -0,0 +1,19 @@
|
||||
version: '2'
|
||||
|
||||
volumes:
|
||||
mails:
|
||||
|
||||
services:
|
||||
server:
|
||||
build: .
|
||||
ports:
|
||||
- 127.0.0.1:8025:8025
|
||||
environment:
|
||||
# GlitchTip DSN errors in the importer's LMTP server will be reported to
|
||||
- OWN_DSN=...
|
||||
# GlitchTip DSNs the error reports will be imported into
|
||||
- NEWPIPE_DSN=...
|
||||
- NEWPIPE_LEGACY_DSN=...
|
||||
volumes:
|
||||
# used for the directory storage
|
||||
- mails:/app/mails
|
Reference in New Issue
Block a user