Added docker support
This commit is contained in:
parent
216b8fe7eb
commit
45026c37dd
1
.env.sample
Normal file
1
.env.sample
Normal file
@ -0,0 +1 @@
|
||||
REBRICKABLE_API_KEY=xxxx
|
6
Dockerfile
Normal file
6
Dockerfile
Normal file
@ -0,0 +1,6 @@
|
||||
FROM python:slim
|
||||
WORKDIR /app
|
||||
COPY requirements.txt .
|
||||
RUN pip install -r requirements.txt
|
||||
COPY . .
|
||||
CMD ["python", "app.py"]
|
@ -1,2 +1,11 @@
|
||||
# LEGOOrganizer
|
||||
|
||||
git clone
|
||||
|
||||
`cp .env.sample .env`
|
||||
|
||||
`nano .env`
|
||||
|
||||
change api key and save file
|
||||
|
||||
docker compose up -d
|
||||
|
8
app.py
8
app.py
@ -1,4 +1,5 @@
|
||||
from flask import Flask, request, redirect, jsonify, render_template, Response,url_for
|
||||
import os
|
||||
import json
|
||||
from flask_socketio import SocketIO
|
||||
from threading import Thread
|
||||
@ -107,9 +108,10 @@ def new_set(set_num):
|
||||
# >>>>>>>>
|
||||
progress(count, total_parts,'Adding set: ' + set_num)
|
||||
|
||||
with open('api','r') as f:
|
||||
api_key = f.read().replace('\n','')
|
||||
rb = rebrick.init(api_key)
|
||||
#with open('api','r') as f:
|
||||
# api_key = f.read().replace('\n','')
|
||||
# TODO add 401 error on wrong key
|
||||
rb = rebrick.init(os.getenv("REBRICKABLE_API_KEY"))
|
||||
|
||||
# >>>>>>>>
|
||||
progress(count, total_parts,'Generating Unique ID')
|
||||
|
10
compose.yaml
Normal file
10
compose.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
services:
|
||||
legoorganizer:
|
||||
container_name: LEGOOrganizer
|
||||
build: .
|
||||
ports:
|
||||
- "5111:3333"
|
||||
volumes:
|
||||
- .:/app
|
||||
env_file:
|
||||
- .env
|
Loading…
Reference in New Issue
Block a user