Skip to content

Commit

Permalink
official docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
asosnoviy committed Oct 21, 2024
1 parent 45b5036 commit 6ce7c25
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 73 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
oscript_modules
oscript_modules
.env
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
GRAFANABOT_TELEGRAMM_TOKEN=12365:jahsJHFhvdgjaJGHF
GRAFANABOT_TELEGRAMM_USERS=66660503,3883884329
GRAFANABOT_TELEGRAMM_GROUPS=-3455345434,-6786786868
GRAFANABOT_GRAFANA_URL=http://grafana.local:3000
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
### Docker

```bash
opm.bat build && cp grafana2telegramm-bot-*.ospx bot.ospx
docker build -t grafanabot -f docker/Dockerfile .

docker run \
-e GRAFANABOT_TELEGRAMM_TOKEN="<12365:jahsJHFhvdgjaJGHF>" \
-e GRAFANABOT_TELEGRAMM_TOKEN="12365:jahsJHFhvdgjaJGHF" \
-e GRAFANABOT_TELEGRAMM_USERS="66660503,3883884329" \
-e GRAFANABOT_TELEGRAMM_GROUPS="-3455345434,-6786786868" \
-e GRAFANABOT_GRAFANA_URL="http://grafana.local:3000" \
Expand All @@ -46,13 +47,11 @@ Telegramm bot for sending grafana dashboards from playlistst.

```bash

docker build -t grafanabot -f docker/Dockerfile .

docker run \
-e GRAFANABOT_TELEGRAMM_TOKEN="<12365:jahsJHFhvdgjaJGHF>" \
-e GRAFANABOT_TELEGRAMM_TOKEN="12365:jahsJHFhvdgjaJGHF" \
-e GRAFANABOT_TELEGRAMM_USERS="66660503,3883884329" \
-e GRAFANABOT_TELEGRAMM_GROUPS="-3455345434,-6786786868" \
-e GRAFANABOT_GRAFANA_URL="http://grafana.local:3000" \
grafanabot
asosnoviy/grafanabot:latest

```
68 changes: 7 additions & 61 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,68 +1,14 @@
ARG DOCKER_USERNAME=library
ARG BASE_IMAGE=debian
ARG BASE_TAG=bullseye-slim
FROM evilbeaver/onescript:dev

FROM library/adoptopenjdk:latest

# Installing mono and oscript dependencies
ARG MONO_VERSION=6.12.0.122

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
gnupg \
dirmngr \
wget \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb http://download.mono-project.com/repo/debian stable-buster main" > /etc/apt/sources.list.d/mono-official-stable.list \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
mono-runtime \
ca-certificates-mono \
libmono-i18n4.0-all \
libmono-system-runtime-serialization4.0-cil \
&& rm -rf /etc/apt/sources.list.d/mono-official-stable.list \
&& apt-get update \
&& cert-sync --user /etc/ssl/certs/ca-certificates.crt \
&& rm -rf \
/var/lib/apt/lists/* \
/var/cache/debconf \
/tmp/*

# remove DST Root CA X3 cert if it exists
#COPY ./scripts/remove-dst-root-ca-x3.sh /remove-dst-root-ca-x3.sh
#RUN chmod +x /remove-dst-root-ca-x3.sh \
# && /remove-dst-root-ca-x3.sh \
# && rm /remove-dst-root-ca-x3.sh

# Installing oscript
ARG OVM_REPOSITORY_OWNER=oscript-library
ARG OVM_VERSION=v1.0.0-RC16
ARG ONESCRIPT_VERSION=stable
ARG ONESCRIPT_PACKAGES="autumn winow json"

RUN wget https://github.com/${OVM_REPOSITORY_OWNER}/ovm/releases/download/${OVM_VERSION}/ovm.exe \
&& mv ovm.exe /usr/local/bin/ \
&& echo 'mono /usr/local/bin/ovm.exe "$@"' | tee /usr/local/bin/ovm \
&& chmod +x /usr/local/bin/ovm \
&& ovm use --install ${ONESCRIPT_VERSION}

ENV OSCRIPTBIN=/root/.local/share/ovm/current/bin
ENV PATH="$OSCRIPTBIN:$PATH"

# Update and prepare oscript packages
WORKDIR /app

COPY ./packagedef .

RUN opm install opm && opm install -l


COPY ./ ./
# COPY ./autumn-properties_my.json ./autumn-properties.json
COPY bot.ospx .
RUN opm install opm && opm install -f bot.ospx

COPY ./docker/entrypoint.sh /
RUN chmod 755 /entrypoint.sh \
&& chmod +x /entrypoint.sh
COPY ./src ./src
COPY ./main.os .
COPY ./oscript.cfg.example ./oscript.cfg

ENTRYPOINT ["/entrypoint.sh"]
CMD ["grafana2telegramm-bot"]
4 changes: 0 additions & 4 deletions docker/entrypoint.sh

This file was deleted.

2 changes: 1 addition & 1 deletion main.os
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
Совет.ПрефиксПеременныхСреды("GRAFANABOT");

Поделка = Новый Поделка(Совет);
Поделка.ПросканироватьКаталог(ОбъединитьПути(ТекущийКаталог() + "/src/core", "Классы"));
Поделка.ПросканироватьКаталог(ОбъединитьПути(ТекущийКаталог() + "src/core", "Классы"));
Поделка.ЗапуститьПриложение();
2 changes: 1 addition & 1 deletion oscript.cfg.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lib.system=./oscript_modules
lib.additional=./oscript_modules

0 comments on commit 6ce7c25

Please sign in to comment.