forked from ArchiveTeam/warrior-dockerfile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (31 loc) · 2.05 KB
/
Dockerfile
File metadata and controls
43 lines (31 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Use phusion/baseimage as base image.
FROM phusion/baseimage:0.9.22
# Set environment variables.
ENV HOME /root
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
ADD get-wget-lua.sh /
# Install dependencies
RUN apt-get update && apt-get install -y curl python python3 python-pip python3-pip git pciutils sudo net-tools isc-dhcp-client python-software-properties wget libgnutls-dev liblua5.1-0 liblua5.1-0-dev autoconf flex \
&& chmod +x /get-wget-lua.sh && sync && bash -c "/get-wget-lua.sh" \
&& apt-get remove -y libgnutls-dev liblua5.1-0-dev autoconf flex && apt-get clean && apt-get autoremove -y
# Fix dnsmasq bug (see https://github.com/nicolasff/docker-cassandra/issues/8#issuecomment-36922132)
RUN echo 'user=root' >> /etc/dnsmasq.conf
# Setup system for the warrior
RUN useradd warrior
RUN echo "warrior ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN mkdir /home/warrior && chown warrior: /home/warrior
# Clone warrior code
RUN (cd /home/warrior && sudo -u warrior git clone -b docker https://github.com/ArchiveTeam/warrior-code2.git)
# Add the boot script (this will install the actual warrior on boot)
RUN mkdir -p /etc/my_init.d
ADD boot.sh /etc/my_init.d/warrior-boot.sh
# Expose web interface port
EXPOSE 8001
# Add the warrior service entry for runit
RUN mkdir /etc/service/warrior
ADD warrior.sh /etc/service/warrior/run
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN curl 'http://localhost:8001/api/settings' -H 'Origin: http://localhost:8001' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Referer: http://localhost:8001/' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data 'downloader=torild&concurrent_items=2&http_username=&http_password=' --compressed
RUN curl 'http://localhost:8001/api/select-project' -H 'Origin: http://localhost:8001' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Referer: http://localhost:8001/' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data 'project_name=auto' --compressed