added docker compose file

This commit is contained in:
benninghoven 2024-04-13 22:30:22 -07:00
parent f101afae80
commit affc92b094
5 changed files with 31 additions and 20 deletions

10
backend/db/init.sql Normal file
View file

@ -0,0 +1,10 @@
CREATE DATABASE IF NOT EXISTS image_database;
USE image_database;
CREATE TABLE IF NOT EXISTS images (
id INT AUTO_INCREMENT PRIMARY KEY,
filename VARCHAR(255) NOT NULL,
filepath VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

0
backend/db/my.cnf Normal file
View file

View file

@ -0,0 +1,21 @@
version: '3.8'
services:
db:
image: mysql:8
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: mydb
MYSQL_USER: myuser
MYSQL_PASSWORD: password
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./db/my.cnf:/etc/mysql/my.cnf
volumes:
mysql_data:

View file

@ -1,13 +0,0 @@
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/api', methods=['POST'])
def api():
data = request.get_json()
return jsonify(data)
if __name__ == '__main__':
app.run(debug=True)

View file

@ -1,7 +0,0 @@
blinker==1.7.0
click==8.1.7
Flask==3.0.3
itsdangerous==2.1.2
Jinja2==3.1.3
MarkupSafe==2.1.5
Werkzeug==3.0.2