diff --git a/backend/Dockerfile b/backend/Dockerfile index b1b2c0e..2de3436 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -22,4 +22,5 @@ ENV FLASK_APP=app.py ENV FLASK_ENV=production CMD uv run flask db upgrade && \ + uv run flask seed products && \ uv run gunicorn --bind 0.0.0.0:5000 'app:create_app()' \ No newline at end of file diff --git a/backend/app/database/seeders.py b/backend/app/database/seeders.py index 144d464..ff6be98 100644 --- a/backend/app/database/seeders.py +++ b/backend/app/database/seeders.py @@ -20,7 +20,7 @@ def seed_products(): description="Paracetamol 650mg is an effective analgesic and antipyretic medication used to relieve mild to moderate pain and reduce fever. It is ideal for conditions such as common cold, flu, headaches, toothaches, menstrual cramps, and muscle pain. Its fast-acting formula ensures quick relief with minimal side effects.", price=5.99, expiry_date=datetime.now() + timedelta(days=730), - image_url="/static/images/products/paracetamol.jpg", + image_url="/static/images/products/paracetamol.png", ), Product( name="Ibuprofen 400mg", @@ -36,7 +36,7 @@ def seed_products(): description="Amoxicillin 500mg is a broad-spectrum antibiotic used to treat a variety of bacterial infections, including respiratory tract infections, ear infections, urinary tract infections, and skin infections. It works by stopping the growth of bacteria, promoting quick recovery from infections.", price=12.99, expiry_date=datetime.now() + timedelta(days=365), - image_url="/static/images/products/amoxicillin.jpg", + image_url="/static/images/products/amoxicillin.png", ), Product( name="Cetirizine Hydrochloride 10mg", @@ -60,7 +60,7 @@ def seed_products(): description="Metformin 500mg is a first-line medication for managing type 2 diabetes. It helps regulate blood sugar levels by improving insulin sensitivity and reducing glucose production in the liver. It is an essential part of diabetes management plans, often combined with diet and exercise.", price=7.99, expiry_date=datetime.now() + timedelta(days=540), - image_url="/static/images/products/metformin.jpg", + image_url="/static/images/products/metformin.png", ), Product( name="Atorvastatin 20mg", @@ -164,7 +164,7 @@ def seed_products(): description="Vitamin D3 1000 IU supports bone health, immune function, and overall wellness by aiding calcium absorption in the body. It is especially beneficial for individuals with limited sun exposure or those at risk of vitamin D deficiency. Ideal for daily supplementation.", price=9.99, expiry_date=datetime.now() + timedelta(days=1095), - image_url="/static/images/products/vitamin-d3.avif", + image_url="/static/images/products/vitamin-d3.webp", ), ] diff --git a/backend/app/static/images/products/levothyroxine.avif b/backend/app/static/images/products/levothyroxine.avif index 65619cc..9f2e77f 100644 Binary files a/backend/app/static/images/products/levothyroxine.avif and b/backend/app/static/images/products/levothyroxine.avif differ diff --git a/backend/app/static/images/products/losartan.png b/backend/app/static/images/products/losartan.png index 6373f6a..89d1515 100644 Binary files a/backend/app/static/images/products/losartan.png and b/backend/app/static/images/products/losartan.png differ diff --git a/backend/app/static/images/products/vitamin-d3.avif b/backend/app/static/images/products/vitamin-d3.avif deleted file mode 100644 index f678038..0000000 Binary files a/backend/app/static/images/products/vitamin-d3.avif and /dev/null differ diff --git a/backend/app/static/images/products/vitamin-d3.webp b/backend/app/static/images/products/vitamin-d3.webp new file mode 100644 index 0000000..b781198 Binary files /dev/null and b/backend/app/static/images/products/vitamin-d3.webp differ diff --git a/docker-compose.yml b/docker-compose.yml index 909bf85..ba65928 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,6 +28,7 @@ services: - "80:80" volumes: - ./nginx.conf:/etc/nginx/conf.d/default.conf + - ./backend/app/static:/app/static depends_on: - backend networks: