Initial commit.

Signed-off-by: Pavel Kirilin <win10@list.ru>
This commit is contained in:
2021-06-07 02:15:45 +04:00
commit 2091068ef6
32 changed files with 2233 additions and 0 deletions

View File

@ -0,0 +1,8 @@
version: '3.7'
services:
test_lenochka:
container_name: the_test_lenochka
build:
dockerfile: ./deploy/dockerfiles/test.Dockerfile
context: .

11
deploy/docker-compose.yml Normal file
View File

@ -0,0 +1,11 @@
version: '3.7'
services:
lenochka:
container_name: the_lenochka
build:
dockerfile: ./deploy/dockerfiles/Dockerfile
context: .
image: docker.le-memese.com/bots/lenochka-bot:${CI_COMMIT_REF_SLUG:-latest}
env_file:
- .gen.env

View File

@ -0,0 +1,37 @@
FROM python:3.9-alpine3.13
RUN adduser --disabled-password lenochka
RUN apk add --no-cache curl gcc musl-dev
ENV POETRY_VERSION 1.1.6
USER lenochka
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
ENV PATH="${PATH}:/home/lenochka/.poetry/bin:/home/lenochka/.local/bin"
RUN source "/home/lenochka/.poetry/env"
# Installing requirements
RUN poetry config virtualenvs.create false
COPY pyproject.toml poetry.lock /home/lenochka/app/
WORKDIR /home/lenochka/app/
RUN poetry install --no-dev
# Copying actuall application
COPY . /home/lenochka/app/src/
WORKDIR /home/lenochka/app/src/
RUN pip install --use-feature=in-tree-build .
WORKDIR /home/lenochka/app
USER root
RUN rm -rf /home/lenochka/app/src
RUN chown -R lenochka /home/lenochka
RUN chmod -R 700 /home/lenochka
RUN apk del curl gcc musl-dev
USER lenochka
CMD "lenochka_wake_up"

View File

@ -0,0 +1,17 @@
FROM python:3.9-alpine3.13
RUN apk add --no-cache curl gcc musl-dev
ENV POETRY_VERSION 1.1.6
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
ENV PATH="${PATH}:/root/.local/bin:/root/.poetry/bin"
RUN source "/root/.poetry/env"
# Installing requirements
RUN poetry config virtualenvs.create false
COPY . /app/
WORKDIR /app/
RUN poetry install