Skip to content

Commit

Permalink
feat: update Dockerfile and seed_products to use PNG images and confi…
Browse files Browse the repository at this point in the history
…gure static file volume
  • Loading branch information
hackerman70000 committed Feb 1, 2025
1 parent f7693ae commit 111a599
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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()'
8 changes: 4 additions & 4 deletions backend/app/database/seeders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
),
]

Expand Down
Binary file modified backend/app/static/images/products/levothyroxine.avif
Binary file not shown.
Binary file modified backend/app/static/images/products/losartan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed backend/app/static/images/products/vitamin-d3.avif
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 111a599

Please sign in to comment.