Start of docker stuff
This commit is contained in:
parent
9c35196867
commit
a78b15aab7
7 changed files with 58 additions and 9 deletions
5
.env
Normal file
5
.env
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
CLIENT_PORT = 8000
|
||||||
|
SERVER_PORT = 19054
|
||||||
|
|
||||||
|
SOUND_LOCATION = C:\Users\dylan\Music
|
||||||
|
DB_LOCATION = C:\Users\dylan\Document
|
||||||
7
Client/Dockerfile
Normal file
7
Client/Dockerfile
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
FROM httpd:2.4
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY . /usr/local/apache2/htdocs
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
19
Compose.yaml
Normal file
19
Compose.yaml
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
name: party-jukebox
|
||||||
|
|
||||||
|
services:
|
||||||
|
pj-client:
|
||||||
|
build: ./client
|
||||||
|
ports:
|
||||||
|
- ${CLIENT_PORT:-80}:80
|
||||||
|
pj-db-builder:
|
||||||
|
# tbd
|
||||||
|
pj-server:
|
||||||
|
build: ./server
|
||||||
|
depends_on:
|
||||||
|
pj-db-builder:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
ports:
|
||||||
|
- ${SERVER_PORT:-19054}:19054
|
||||||
|
volumes:
|
||||||
|
- ${SOUND_LOCATION}:/sound
|
||||||
|
- ${DB_LOCATION}:/db
|
||||||
14
Server/Dockerfile
Normal file
14
Server/Dockerfile
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
FROM python:3.13
|
||||||
|
workdir /app2
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get upgrade
|
||||||
|
#RUN apt-get install vlc -y
|
||||||
|
#RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
# RUN python3 databaseGenerator.py -m new -d /sound
|
||||||
|
|
||||||
|
#CMD ["python3","webbyBits.py"]
|
||||||
|
RUN ls
|
||||||
|
|
@ -11,19 +11,21 @@ parser.add_argument('-k','--apikey', help='String: LastFM api key', default="")
|
||||||
parser.add_argument('-m', '--mode', help='new/update: Remake database or update current', default= "update")
|
parser.add_argument('-m', '--mode', help='new/update: Remake database or update current', default= "update")
|
||||||
parser.add_argument('-a', '--art', help="True/False: Add art to the database using LastFm (takes minimum 0.25s per song)", default="True")
|
parser.add_argument('-a', '--art', help="True/False: Add art to the database using LastFm (takes minimum 0.25s per song)", default="True")
|
||||||
parser.add_argument('-d','--directory',help="Directory of the song files", default="./sound/")
|
parser.add_argument('-d','--directory',help="Directory of the song files", default="./sound/")
|
||||||
|
parser.add_argument('-b','--database',help="Location of the .db file",default='.')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
apikeylastfm = args.apikey
|
apikeylastfm = args.apikey
|
||||||
if args.directory[-1] == "/" or args.directory[-1] == "\\":
|
|
||||||
soundLocation = args.directory
|
soundLocation = args.directory
|
||||||
elif "/" in args.directory:
|
# if args.directory[-1] == "/" or args.directory[-1] == "\\":
|
||||||
soundLocation = args.directory + "/"
|
# soundLocation = args.directory
|
||||||
else:
|
# elif "/" in args.directory:
|
||||||
soundLocation = args.directory + "\\"
|
# soundLocation = args.directory + "/"
|
||||||
|
# else:
|
||||||
|
# soundLocation = args.directory + "\\"
|
||||||
# if you want to set the api key/sound directory permenantly for your setup just uncomment the next line
|
# if you want to set the api key/sound directory permenantly for your setup just uncomment the next line
|
||||||
# apikeylastfm = "KeyHere"
|
# apikeylastfm = "KeyHere"
|
||||||
# soundLocation = "directoryHere"
|
# soundLocation = "directoryHere"
|
||||||
songFiles = os.listdir(soundLocation)
|
songFiles = os.listdir(soundLocation)
|
||||||
fileOfDB = sql.connect("songDatabase.db")
|
fileOfDB = sql.connect(args.database+"/songDatabase.db")
|
||||||
songDatabase = fileOfDB.cursor()
|
songDatabase = fileOfDB.cursor()
|
||||||
# setting song directory
|
# setting song directory
|
||||||
songDatabase.execute("CREATE TABLE IF NOT EXISTS meta (id TEXT PRIMARY KEY, data TEXT);")
|
songDatabase.execute("CREATE TABLE IF NOT EXISTS meta (id TEXT PRIMARY KEY, data TEXT);")
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,11 @@ parser=argparse.ArgumentParser(description="Options for the Webby Bits")
|
||||||
# this is no longer needed assuming my file works correctly with the generator
|
# this is no longer needed assuming my file works correctly with the generator
|
||||||
# parser.add_argument('-d','--directory',help="Directory of the song files (make sure this matches the directory used for the databaseGenerator)", default="./sound/")
|
# parser.add_argument('-d','--directory',help="Directory of the song files (make sure this matches the directory used for the databaseGenerator)", default="./sound/")
|
||||||
parser.add_argument('-p','--port',help="Port to host on, not the same as the web (client) port",default='19054')
|
parser.add_argument('-p','--port',help="Port to host on, not the same as the web (client) port",default='19054')
|
||||||
portTheUserPicked=parser.parse_args().port
|
parser.add_argument('-b','--database',help="Location of the .db file",default='.')
|
||||||
|
args = parser.parse_args()
|
||||||
|
portTheUserPicked=args.port
|
||||||
|
|
||||||
fileofDB = sql.connect("songDatabase.db")
|
fileofDB = sql.connect(args.database+"/songDatabase.db")
|
||||||
songDatabase = fileofDB.cursor()
|
songDatabase = fileofDB.cursor()
|
||||||
|
|
||||||
#song directory
|
#song directory
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue