Browse Source

Dockerization and instructions

ekardnam 4 years ago
parent
commit
18db8f7f7e
2 changed files with 25 additions and 4 deletions
  1. 10 0
      Dockerfile
  2. 15 4
      README.md

+ 10 - 0
Dockerfile

@@ -0,0 +1,10 @@
+FROM python:3
+
+WORKDIR /usr/src/app
+
+# Bundle app source
+COPY . .
+
+RUN pip install -r requirements.txt
+
+CMD ["python", "run.py"]

+ 15 - 4
README.md

@@ -13,13 +13,24 @@ Requires:
 * python3
 * pip
 
-### Steps
+### Steps with Docker
 
 1. `git clone https://git.lattuga.net/ekardnam/mastodon-welcome-bot`
-2. `pip install -r requirements.txt` (you'll probably want to setup a [virtualenv](https://www.pythonforbeginners.com/basics/how-to-use-python-virtualenv) for this)
-3. `cp .env.dist .env` 
+2. `cd mastodon-welcome-bot`
+3. `cp .env.dist .env`
 4. Fill in the env vars as required in the `.env` file (see definitions below)
-5. Run the app with `python run.py`
+5. `docker build -t . mastodon-welcome-message`
+5. Run the app with `docker run -d mastodon-welcome-bot`
+
+### Steps without Docker
+1. `git clone https://git.lattuga.net/ekardnam/mastodon-welcome-bot`
+2. `cd mastodon-welcome-bot`
+3. `virtualenv .venv`
+4. `source .venv/bin/activate`
+5. `pip install -r requirements.txt`
+6. `cp .env.dist .env`
+7. Fill in the env vars as required in the `.env` file (see definitions below)
+8. `python3 run.py`
 
 ### Environment Variables