mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
working docker-compose for postgres
This commit is contained in:
parent
d448d4453b
commit
0342aa1037
6 changed files with 31 additions and 28 deletions
18
Dockerfile
18
Dockerfile
|
@ -16,14 +16,11 @@ ENV POETRY_VERSION 1.1.6
|
|||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc g++ \
|
||||
curl \
|
||||
python3-dev \
|
||||
build-essential \
|
||||
libssl-dev \
|
||||
libffi-dev \
|
||||
gnupg gnupg2 gnupg1 \
|
||||
apt-transport-https \
|
||||
debian-archive-keyring \
|
||||
debian-keyring \
|
||||
libpq-dev \
|
||||
libwebp-dev \
|
||||
&& curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | apt-key add - \
|
||||
&& curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee -a /etc/apt/sources.list.d/caddy-stable.list \
|
||||
|
@ -35,12 +32,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||
|
||||
|
||||
RUN pip install --no-cache-dir "poetry==$POETRY_VERSION"
|
||||
RUN pip install --no-cache-dir "psycopg2-binary==2.8.6"
|
||||
|
||||
#! Future
|
||||
# pip install --no-cache-dir "psycopg2-binary==2.8.6"
|
||||
|
||||
# project dependencies
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml /app/
|
||||
COPY pyproject.toml poetry.lock /app/
|
||||
RUN poetry config virtualenvs.create false
|
||||
RUN poetry install --no-dev --no-interaction --no-ansi
|
||||
|
||||
COPY ./mealie /app/mealie
|
||||
RUN poetry config virtualenvs.create false \
|
||||
&& poetry install --no-dev
|
||||
|
@ -48,7 +47,6 @@ RUN poetry config virtualenvs.create false \
|
|||
#! Future
|
||||
# COPY ./alembic /app
|
||||
# COPY alembic.ini /app
|
||||
|
||||
COPY ./Caddyfile /app
|
||||
COPY ./dev/data/templates /app/data/templates
|
||||
|
||||
|
@ -59,4 +57,4 @@ VOLUME [ "/app/data/" ]
|
|||
|
||||
EXPOSE 80
|
||||
|
||||
CMD /app/mealie/run.sh
|
||||
CMD /app/mealie/run.sh
|
||||
|
|
|
@ -8,4 +8,17 @@ services:
|
|||
restart: always
|
||||
ports:
|
||||
- 9090:80
|
||||
|
||||
environment:
|
||||
DB_ENGINE: postgres # Optional: 'sqlite', 'postgres'
|
||||
POSTGRES_USER: mealie
|
||||
POSTGRES_PASSWORD: mealie
|
||||
POSTGRES_SERVER: postgres
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_DB: mealie
|
||||
postgres:
|
||||
container_name: postgres
|
||||
image: postgres
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_PASSWORD: mealie
|
||||
POSTGRES_USER: mealie
|
||||
|
|
|
@ -30,7 +30,7 @@ class MealPlanModel(SqlAlchemyBase, BaseMixins):
|
|||
startDate = sa.Column(sa.Date)
|
||||
endDate = sa.Column(sa.Date)
|
||||
meals: List[Meal] = orm.relationship(Meal, cascade="all, delete, delete-orphan")
|
||||
group_id = sa.Column(sa.String, sa.ForeignKey("groups.id"))
|
||||
group_id = sa.Column(sa.Integer, sa.ForeignKey("groups.id"))
|
||||
group = orm.relationship("Group", back_populates="mealplans")
|
||||
|
||||
def __init__(self, startDate, endDate, meals, group: str, uid=None, session=None) -> None:
|
||||
|
|
|
@ -10,29 +10,29 @@ logger = root_logger.get_logger()
|
|||
site_settings2categories = sa.Table(
|
||||
"site_settings2categories",
|
||||
SqlAlchemyBase.metadata,
|
||||
sa.Column("sidebar_id", sa.Integer, sa.ForeignKey("site_settings.id")),
|
||||
sa.Column("category_id", sa.String, sa.ForeignKey("categories.id")),
|
||||
sa.Column("site_settings.id", sa.Integer, sa.ForeignKey("site_settings.id")),
|
||||
sa.Column("category_id", sa.Integer, sa.ForeignKey("categories.id")),
|
||||
)
|
||||
|
||||
group2categories = sa.Table(
|
||||
"group2categories",
|
||||
SqlAlchemyBase.metadata,
|
||||
sa.Column("group_id", sa.Integer, sa.ForeignKey("groups.id")),
|
||||
sa.Column("category_id", sa.String, sa.ForeignKey("categories.id")),
|
||||
sa.Column("category_id", sa.Integer, sa.ForeignKey("categories.id")),
|
||||
)
|
||||
|
||||
recipes2categories = sa.Table(
|
||||
"recipes2categories",
|
||||
SqlAlchemyBase.metadata,
|
||||
sa.Column("recipe_id", sa.Integer, sa.ForeignKey("recipes.id")),
|
||||
sa.Column("category_id", sa.String, sa.ForeignKey("categories.id")),
|
||||
sa.Column("category_id", sa.Integer, sa.ForeignKey("categories.id")),
|
||||
)
|
||||
|
||||
custom_pages2categories = sa.Table(
|
||||
"custom_pages2categories",
|
||||
SqlAlchemyBase.metadata,
|
||||
sa.Column("custom_page_id", sa.Integer, sa.ForeignKey("custom_pages.id")),
|
||||
sa.Column("category_id", sa.String, sa.ForeignKey("categories.id")),
|
||||
sa.Column("category_id", sa.Integer, sa.ForeignKey("categories.id")),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -10,11 +10,7 @@ class SiteSettings(SqlAlchemyBase, BaseMixins):
|
|||
id = sa.Column(sa.Integer, primary_key=True)
|
||||
language = sa.Column(sa.String)
|
||||
first_day_of_week = sa.Column(sa.Integer)
|
||||
categories = orm.relationship(
|
||||
"Category",
|
||||
secondary=site_settings2categories,
|
||||
single_parent=True,
|
||||
)
|
||||
categories = orm.relationship("Category", secondary=site_settings2categories, single_parent=True)
|
||||
show_recent = sa.Column(sa.Boolean, default=True)
|
||||
cards_per_section = sa.Column(sa.Integer)
|
||||
|
||||
|
@ -44,11 +40,7 @@ class CustomPage(SqlAlchemyBase, BaseMixins):
|
|||
position = sa.Column(sa.Integer, nullable=False)
|
||||
name = sa.Column(sa.String, nullable=False)
|
||||
slug = sa.Column(sa.String, nullable=False)
|
||||
categories = orm.relationship(
|
||||
"Category",
|
||||
secondary=custom_pages2categories,
|
||||
single_parent=True,
|
||||
)
|
||||
categories = orm.relationship("Category", secondary=custom_pages2categories, single_parent=True)
|
||||
|
||||
def __init__(self, session=None, name=None, slug=None, position=0, categories=[], *args, **kwargs) -> None:
|
||||
self.name = name
|
||||
|
|
|
@ -16,7 +16,7 @@ class User(SqlAlchemyBase, BaseMixins):
|
|||
full_name = Column(String, index=True)
|
||||
email = Column(String, unique=True, index=True)
|
||||
password = Column(String)
|
||||
group_id = Column(String, ForeignKey("groups.id"))
|
||||
group_id = Column(Integer, ForeignKey("groups.id"))
|
||||
group = orm.relationship("Group", back_populates="users")
|
||||
admin = Column(Boolean, default=False)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue