forked from Nexius2/Plex_User_Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (27 loc) · 1.13 KB
/
Dockerfile
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
FROM python:3.8-slim
RUN apt-get update && apt-get install -y \
python3-tk \
mariadb-server \
python3-pip \
wget
RUN python3 -m venv /venv
RUN ls -la /venv
ENV PATH="/venv/bin:$PATH"
RUN echo $PATH
RUN chmod +x /venv/bin/activate
RUN /venv/bin/python3 -m pip install --upgrade pip
# RUN wget https://raw.githubusercontent.com/blacktwin/JBOPS/master/utility/plex_api_share.py \
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8010
ENV MYSQL_ROOT_PASSWORD=PUM-USER
RUN service mariadb status | grep -q 'Active: active (running)' || service mariadb start
RUN service mariadb status
# Create a new database and user
RUN service mysql start \
&& mysql -u root -p$MYSQL_ROOT_PASSWORD -e "CREATE SCHEMA IF NOT EXISTS pum DEFAULT CHARACTER SET utf8;" \
&& mysql -u root -p$MYSQL_ROOT_PASSWORD -e "CREATE USER IF NOT EXISTS 'pumuser'@'%' IDENTIFIED BY 'PUM-USER';" \
&& mysql -u root -p$MYSQL_ROOT_PASSWORD -e "GRANT ALL PRIVILEGES ON pum.* TO 'pumuser'@'%';" \
&& mysql -u root -p$MYSQL_ROOT_PASSWORD -e "FLUSH PRIVILEGES;"
CMD ["/venv/bin/python", "pum.py"]