mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
Switch docker to debian
This commit is contained in:
parent
5c41f5dfd7
commit
e8d7b1f177
8 changed files with 69 additions and 76 deletions
|
@ -1,3 +1,4 @@
|
|||
.git/
|
||||
*/node_modules
|
||||
*/dist
|
||||
*/data/db
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
auto_https off
|
||||
auto_https off
|
||||
admin off
|
||||
}
|
||||
|
||||
|
@ -18,5 +18,4 @@
|
|||
try_files {path}.html {path} /
|
||||
file_server
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
66
Dockerfile
66
Dockerfile
|
@ -1,3 +1,4 @@
|
|||
# build
|
||||
FROM node:lts-alpine as build-stage
|
||||
WORKDIR /app
|
||||
COPY ./frontend/package*.json ./
|
||||
|
@ -5,51 +6,46 @@ RUN npm install
|
|||
COPY ./frontend/ .
|
||||
RUN npm run build
|
||||
|
||||
FROM python:3.9-alpine
|
||||
|
||||
|
||||
RUN apk add --no-cache libxml2-dev \
|
||||
libxslt-dev \
|
||||
libxml2 caddy \
|
||||
libffi-dev \
|
||||
python3 \
|
||||
python3-dev \
|
||||
jpeg-dev \
|
||||
lcms2-dev \
|
||||
openjpeg-dev \
|
||||
zlib-dev
|
||||
|
||||
# run
|
||||
FROM python:3.9-buster
|
||||
|
||||
ENV PRODUCTION true
|
||||
EXPOSE 80
|
||||
WORKDIR /app/
|
||||
ENV POETRY_VERSION 1.1.6
|
||||
|
||||
COPY ./pyproject.toml /app/
|
||||
RUN apt-get update && apt-get install -y \
|
||||
apt-transport-https \
|
||||
debian-archive-keyring \
|
||||
debian-keyring \
|
||||
&& 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 \
|
||||
&& apt-get update && apt-get install -y \
|
||||
caddy \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN apk add --update --no-cache --virtual .build-deps \
|
||||
curl \
|
||||
g++ \
|
||||
python3-dev \
|
||||
musl-dev \
|
||||
gcc \
|
||||
build-base && \
|
||||
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && \
|
||||
cd /usr/local/bin && \
|
||||
ln -s /opt/poetry/bin/poetry && \
|
||||
poetry config virtualenvs.create false && \
|
||||
cd /app/ && poetry install --no-root --no-dev && \
|
||||
apk --purge del .build-deps
|
||||
# poetry
|
||||
RUN pip install --no-cache-dir "poetry==$POETRY_VERSION"
|
||||
|
||||
# database drivers
|
||||
RUN pip install --no-cache-dir "psycopg2-binary==2.8.6"
|
||||
|
||||
# project dependencies
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml poetry.lock /app/
|
||||
RUN poetry config virtualenvs.create false
|
||||
RUN poetry install --no-root --no-dev --no-interaction --no-ansi
|
||||
|
||||
# project code
|
||||
COPY ./mealie /app/mealie
|
||||
RUN poetry install --no-dev
|
||||
# add database drivers
|
||||
RUN pip install psycopg2-binary
|
||||
|
||||
COPY ./alembic /app
|
||||
COPY alembic.ini /app
|
||||
COPY ./Caddyfile /app
|
||||
COPY ./dev/data/templates /app/data/templates
|
||||
|
||||
# frontend build
|
||||
COPY --from=build-stage /app/dist /app/dist
|
||||
|
||||
VOLUME [ "/app/data/" ]
|
||||
|
||||
RUN chmod +x /app/mealie/run.sh
|
||||
EXPOSE 80
|
||||
|
||||
CMD /app/mealie/run.sh
|
||||
|
|
|
@ -1,24 +1,23 @@
|
|||
FROM python:3
|
||||
|
||||
WORKDIR /app/
|
||||
FROM python:3.9-buster
|
||||
|
||||
ENV PRODUCTION false
|
||||
ENV POETRY_VERSION 1.1.6
|
||||
|
||||
RUN apt-get update -y && \
|
||||
apt-get install -y python-pip python-dev
|
||||
# poetry
|
||||
RUN pip install --no-cache-dir "poetry==$POETRY_VERSION"
|
||||
|
||||
# Install Poetry
|
||||
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && \
|
||||
cd /usr/local/bin && \
|
||||
ln -s /opt/poetry/bin/poetry && \
|
||||
poetry config virtualenvs.create false
|
||||
# database drivers
|
||||
RUN pip install --no-cache-dir "psycopg2-binary==2.8.6"
|
||||
|
||||
# Copy poetry.lock* in case it doesn't exist in the repo
|
||||
COPY ./pyproject.toml /app/
|
||||
# project dependencies
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml poetry.lock /app/
|
||||
RUN poetry config virtualenvs.create false
|
||||
RUN poetry install --no-root --no-dev --no-interaction --no-ansi
|
||||
|
||||
# project code
|
||||
COPY ./mealie /app/mealie
|
||||
COPY ./alembic /app/alembic
|
||||
COPY alembic.ini /app
|
||||
|
||||
RUN poetry install
|
||||
|
||||
RUN chmod +x /app/mealie/run.sh
|
||||
CMD ["/app/mealie/run.sh", "reload"]
|
||||
CMD [ "/app/mealie/run.sh", "development" ]
|
||||
|
|
|
@ -240,29 +240,32 @@ def upgrade():
|
|||
op.bulk_insert(site_settings2categories_table, [
|
||||
{
|
||||
"sidebar_id": 1,
|
||||
"category_slug", "thanksgiving",
|
||||
"category_slug": "thanksgiving",
|
||||
},
|
||||
{
|
||||
"sidebar_id": 1,
|
||||
"category_slug", "homechef",
|
||||
"category_slug": "homechef",
|
||||
},
|
||||
{
|
||||
"sidebar_id": 1,
|
||||
"category_slug", "potatoes",
|
||||
"category_slug": "potatoes",
|
||||
},
|
||||
])
|
||||
op.bulk_insert(theme_colors_table, [
|
||||
{
|
||||
"parent_id": "default",
|
||||
"primary": "#E58325",
|
||||
"accent": "#00457A",
|
||||
"secondary": "#973542",
|
||||
"success": "#5AB1BB",
|
||||
"info": "#4990BA",
|
||||
"warning": "#FF4081",
|
||||
"error": "#EF5350",
|
||||
},
|
||||
])
|
||||
op.bulk_insert(site_theme_table, [
|
||||
{
|
||||
"name": "default",
|
||||
"colors": {
|
||||
"primary": "#E58325",
|
||||
"accent": "#00457A",
|
||||
"secondary": "#973542",
|
||||
"success": "#5AB1BB",
|
||||
"info": "#4990BA",
|
||||
"warning": "#FF4081",
|
||||
"error": "#EF5350",
|
||||
},
|
||||
},
|
||||
])
|
||||
op.bulk_insert(groups_table, [
|
||||
|
|
|
@ -27,7 +27,6 @@ services:
|
|||
- 9921:9000
|
||||
environment:
|
||||
TZ: America/Anchorage # Specify Correct Timezone for Date/Time to line up correctly.
|
||||
DB_URL: sqlite:///mealie.db
|
||||
volumes:
|
||||
- ./dev/data:/app/dev/data
|
||||
- ./mealie:/app/mealie
|
||||
|
|
|
@ -8,5 +8,3 @@ services:
|
|||
restart: always
|
||||
ports:
|
||||
- 9090:80
|
||||
environment:
|
||||
DB_URL: sqlite:///mealie.db
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
# Get Reload Arg `run.sh reload` for dev server
|
||||
ARG1=${1:-production}
|
||||
|
@ -10,17 +10,15 @@ ARG1=${1:-production}
|
|||
poetry run alembic upgrade head
|
||||
poetry run python /app/mealie/services/image/minify.py
|
||||
|
||||
# Migrations
|
||||
# TODO
|
||||
# Migrations
|
||||
# Set Port from ENV Variable
|
||||
# Set Port from ENV Variable
|
||||
|
||||
if [[ "$ARG1" = "reload" ]]
|
||||
if [[ "$ARG1" = "development" ]]
|
||||
then
|
||||
echo "Hot Reload!"
|
||||
echo "Development"
|
||||
|
||||
# Start API
|
||||
uvicorn mealie.app:app --host 0.0.0.0 --port 9000 --reload
|
||||
uvicorn mealie.app:app --host 0.0.0.0 --port 9000
|
||||
else
|
||||
echo "Production"
|
||||
# Web Server
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue