ソースを参照

Add docker instructions to readme

Zed 6 年 前
コミット
089cea0042
3 ファイル変更14 行追加7 行削除
  1. 2 1
      Dockerfile
  2. 6 0
      README.md
  3. 6 6
      tests/test_card.py

+ 2 - 1
Dockerfile

@@ -1,7 +1,8 @@
 FROM nimlang/nim:alpine as nim
 MAINTAINER setenforce@protonmail.com
 EXPOSE 8080
-ENV HOSTNAME nitter.net
+ARG HOSTNAME
+ENV HOSTNAME ${HOSTNAME:-nitter.net}
 
 COPY . /src/nitter
 WORKDIR /src/nitter

+ 6 - 0
README.md

@@ -71,6 +71,12 @@ Set your port and page title in `nitter.conf`, then run Nitter by executing `./n
 You should run Nitter behind a reverse proxy such as
 [Nginx](https://github.com/zedeus/nitter/wiki/Nginx) or Apache for better security.
 
+To build and run Nitter in Docker:
+```bash
+docker build -t nitter:latest --build-arg HOSTNAME=nitter.net .
+docker run -d -p 8080:8080 nitter:latest
+```
+
 To run Nitter via systemd you can use this service file:
 
 ```bash

+ 6 - 6
tests/test_card.py

@@ -43,11 +43,6 @@ card = [
      '',
      'www.tesla.com', True],
 
-    ['mobile_test/status/490378953744318464',
-     'Nantasket Beach',
-     'Rocks on the beach.',
-     '500px.com', True],
-
     ['voidtarget/status/1094632512926605312',
      'Basic OBS Studio plugin, written in nim, supporting C++ (C fine too)',
      'Basic OBS Studio plugin, written in nim, supporting C++ (C fine too) - obsplugin.nim',
@@ -73,7 +68,12 @@ no_thumb = [
     ['brent_p/status/1088857328680488961',
      'Hts Nim Sugar',
      'hts-nim is a library that allows one to use htslib via the nim programming language. Nim is a garbage-collected language that compiles to C and often has similar performance. I have become very...',
-     'brentp.github.io']
+     'brentp.github.io'],
+
+    ['mobile_test/status/490378953744318464',
+     'Nantasket Beach',
+     'Rocks on the beach.',
+     '500px.com']
 ]
 
 playable = [