consolidate docker files

This commit is contained in:
hay-kot 2021-04-29 10:16:45 -08:00
commit 349341b100
5 changed files with 2 additions and 134 deletions

View file

@ -1,54 +0,0 @@
FROM node:lts-alpine as build-stage
WORKDIR /app
COPY ./frontend/package*.json ./
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
ENV PRODUCTION true
EXPOSE 80
WORKDIR /app/
COPY ./pyproject.toml /app/
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
COPY ./mealie /app/mealie
RUN poetry install --no-dev
COPY ./Caddyfile /app
COPY ./dev/data/templates /app/data/templates
COPY --from=build-stage /app/dist /app/dist
VOLUME [ "/app/data/" ]
RUN chmod +x /app/mealie/run.sh
CMD /app/mealie/run.sh

View file

@ -1,24 +0,0 @@
FROM python:3
WORKDIR /app/
ENV PRODUCTION false
RUN apt-get update -y && \
apt-get install -y python-pip python-dev
# 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
# Copy poetry.lock* in case it doesn't exist in the repo
COPY ./pyproject.toml /app/
COPY ./mealie /app/mealie
RUN poetry install
RUN chmod +x /app/mealie/run.sh
CMD ["/app/mealie/run.sh", "reload"]

View file

@ -1,42 +0,0 @@
# Use root/example as user/password credentials
version: "3.1"
services:
# Vue Frontend
mealie-frontend:
image: mealie-frontend:dev
build:
context: ./frontend
dockerfile: frontend.Dockerfile
restart: always
ports:
- 9920:8080
environment:
VUE_APP_API_BASE_URL: "http://mealie-api:9000"
volumes:
- ./frontend/:/app
- /app/node_modules
# Fast API
mealie-api:
image: mealie-api:dev
build:
context: ./
dockerfile: Dockerfile.dev
restart: always
ports:
- 9921:9000
environment:
db_type: sqlite
TZ: America/Anchorage # Specify Correct Timezone for Date/Time to line up correctly.
volumes:
- ./dev/data:/app/dev/data
- ./mealie:/app/mealie
# Mkdocs
mealie-docs:
image: squidfunk/mkdocs-material
restart: always
ports:
- 9922:8000
volumes:
- ./docs:/docs

View file

@ -1,12 +0,0 @@
version: "3.1"
services:
mealie:
build:
context: ./
dockerfile: Dockerfile
container_name: mealie
restart: always
ports:
- 9090:80
environment:
db_type: sqlite

View file

@ -71,10 +71,10 @@ docs: ## Start Mkdocs Development Server
cd docs && poetry run python -m mkdocs serve cd docs && poetry run python -m mkdocs serve
docker-dev: ## Build and Start Docker Development Stack docker-dev: ## Build and Start Docker Development Stack
docker-compose -f docker-compose.dev.yml -p dev-mealie up --build docker-compose -f ./docker/docker-compose.dev.yml -p dev-mealie up --build
docker-prod: ## Build and Start Docker Production Stack docker-prod: ## Build and Start Docker Production Stack
docker-compose -p mealie up --build -d docker-compose -f ./docker/docker-compose.yml -p mealie up --build -d
code-gen: ## Run Code-Gen Scripts code-gen: ## Run Code-Gen Scripts
poetry run python dev/scripts/app_routes_gen.py poetry run python dev/scripts/app_routes_gen.py