Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
wonesy committed Dec 19, 2020
0 parents commit 7c90e70
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 0 deletions.
Binary file added Anki.tar.gz
Binary file not shown.
Binary file added Anki2.tar.gz
Binary file not shown.
56 changes: 56 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FROM ubuntu:latest

RUN apt-get update && apt-get -y install curl

RUN mkdir -m 777 /usr/share/desktop-directories

RUN curl -L https://github.com/ankitects/anki/releases/download/2.1.37/anki-2.1.37-linux.tar.bz2 > anki.tar.bz2

RUN tar xjf anki.tar.bz2

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
tzdata \
locales \
xdg-utils \
ca-certificates \
build-essential \
mpv \
lame \
libnss3 \
python3-pyqt5 \
libxcb1 \
libxcb1-dev \
xcb \
python3-xcbgen \
qt5dxcb-plugin \
xserver-xorg-video-dummy \
mplayer locales materia-gtk-theme papirus-icon-theme dmz-cursor-theme

ENV LANG=en_US.UTF-8
ENV DISPLAY=:0.0
ENV ANKICONNECT_BIND_ADDRESS=0.0.0.0
ENV ANKICONNECT_CORS_ORIGIN="*"

RUN echo "Europe/Helsinki" > /etc/timezone && \
echo "LANG=en_US.UTF-8" >> /etc/environment && \
echo "LC_ALL=en_US.UTF-8" >> /etc/environment && \
echo "LANGUAGE=en_US.UTF-8" >> /etc/environment && \
dpkg-reconfigure -f noninteractive tzdata && \
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG="en_US.UTF-8"

RUN locale-gen en_US.UTF-8

COPY xorg.conf /etc/X11

RUN cd anki-2.1.37-linux && sh install.sh

COPY . .

RUN bash tardown.bash

RUN cp ./anki-connect-config.json /root/.local/share/Anki2/addons21/2055492159/config.json

ENTRYPOINT ["./run.bash"]
8 changes: 8 additions & 0 deletions anki-connect-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"apiKey": null,
"apiLogPath": null,
"webBindAddress": "0.0.0.0",
"webBindPort": 8765,
"webCorsOrigin": "*",
"webCorsOriginList": ["*"]
}
7 changes: 7 additions & 0 deletions run.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

X&

sleep 2

anki --no-sandbox
7 changes: 7 additions & 0 deletions tardown.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

LDIR=~/.local/share

mkdir -p ${LDIR}
tar zxvf Anki.tar.gz -C ${LDIR}
tar zxvf Anki2.tar.gz -C ${LDIR}
8 changes: 8 additions & 0 deletions tarup.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

WANKI=$(pwd)

pushd ~/.local/share
tar -zcvf Anki.tar.gz Anki && mv Anki.tar.gz ${WANKI}
tar -zcvf Anki2.tar.gz Anki2 && mv Anki2.tar.gz ${WANKI}
popd
21 changes: 21 additions & 0 deletions xorg.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Section "Device"
Identifier "Configured Video Device"
Driver "dummy"
EndSection

Section "Monitor"
Identifier "Configured Monitor"
HorizSync 31.5-48.5
VertRefresh 50-70
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x800"
EndSubSection
EndSection

0 comments on commit 7c90e70

Please sign in to comment.