Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Amndeep7 committed Apr 8, 2021
2 parents 4c26918 + a0c24e8 commit 8ba7fc9
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM python:3.9.1-slim AS base

ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1 \
PYSETUP_PATH="/opt/pysetup" \
VENV_PATH="/opt/pysetup/.venv"

ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"

FROM base AS builder
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
curl

ENV POETRY_VERSION=1.1.5
RUN curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python

WORKDIR $PYSETUP_PATH
COPY ./poetry.lock ./pyproject.toml ./
RUN poetry install --no-dev

FROM base AS production

COPY --from=builder $VENV_PATH $VENV_PATH

RUN . $VENV_PATH/bin/activate

COPY ./.env /.env
COPY ./mass_mentioner/mass_mentioner.py /mass_mentioner/mass_mentioner.py

ENTRYPOINT ["python3", "/mass_mentioner/mass_mentioner.py"]
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@ The script uses `poetry` as the dependency manager so install that, and then run

### Running it via Docker

Instructions coming soon(tm) for both running it directly via docker and via docker-compose.
It's the usual Docker stuff, yall know what to do. As a reminder:

```sh
# calling Docker directly
docker build -t mass_mentioner:v0.1.0 .
docker run -d --rm mass_mentioner:v0.1.0
```

```sh
# using docker-compose
docker-compose up -d
```

## Usage user side

Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3.7'
services:
mass_mentioner:
build: .
image: mass_mentioner:v0.1.0
restart: always

0 comments on commit 8ba7fc9

Please sign in to comment.