Skip to content

Commit 0d08af3

Browse files
Brandon Davisnetromdk
Brandon Davis
authored andcommitted
Add Docker support
1 parent d5b69d3 commit 0d08af3

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Markdown files
2+
*.md
3+
4+
# Logs
5+
*.log
6+
7+
# Python cache files
8+
*/__pycache__*
9+
10+
# Virtual environment
11+
.venv
12+
13+
# Git
14+
.git
15+
16+
# GitHub templates
17+
.github
18+
19+
# Utility scripts
20+
slacker.sh
21+
.travis.yml
22+
.vulture_whitelist.py
23+
LICENSE
24+
Makefile

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM python:3.7.0-alpine3.8
2+
3+
WORKDIR ['/app/slacker']
4+
5+
COPY . .
6+
7+
RUN pip install -r requirements.txt
8+
9+
ENTRYPOINT ["python3", "slacker.py"]

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ check-min-version:
3131
.venv/bin/vermin -t 3.4 slacker slacker.py
3232

3333
check: check-min-version check-cmds check-style static-analysis
34+
35+
.PHONY: docker
36+
docker:
37+
docker build -t slacker:local .

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The first invocation of Slacker requires to setup a workspace using the `--init`
1717
Input workspace token: ****************************************************************************
1818
Added new workspace 'myworkspace' to config and made it active.
1919
You can now run slacker normally.
20-
myworkspace>
20+
myworkspace>
2121
```
2222

2323
Slacker is ready for use afterwards with "myworkspace" as the active workspace. _Note that it is recommended to employ a user token, not a bot token!_
@@ -72,5 +72,14 @@ To setup a virtual development environment that doesn't pollute the general syst
7272

7373
Run `make setup` to install required modules to ".venv" in the root of the repository, and issue `source .venv/bin/activate` to activate the environment. From here, the `python`, `python3`, `pip` etc. will map to ".venv" and the modules installed into it.
7474

75+
# Docker
76+
A Dockerfile is provided to quickly get up an running with Slacker. To build the Docker image it is recommended to use the `docker` target in the Makefile `make docker`, which creates image `slacker:local`. Start the slacker container by executing `docker_run.sh`. By default the script will drop you into the REPL, but slacker commands can be given directly to the script.
77+
78+
```
79+
% ./docker_run.sh -- files.list -c 10
80+
```
81+
82+
> **Note:** slacker writes a configuration file to disk (`~/.slacker`). In order to keep the configuration file between subsequent runs the local volume mount in the container is required.
83+
7584
# Contributing
7685
See [CONTRIBUTING.md](CONTRIBUTING.md).

0 commit comments

Comments
 (0)