added docker compose file
This commit is contained in:
parent
f101afae80
commit
affc92b094
5 changed files with 31 additions and 20 deletions
10
backend/db/init.sql
Normal file
10
backend/db/init.sql
Normal 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
0
backend/db/my.cnf
Normal file
21
backend/docker-compose.yml
Normal file
21
backend/docker-compose.yml
Normal 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:
|
||||
|
|
@ -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)
|
|
@ -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
|
Loading…
Reference in a new issue