mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 22:43:34 -07:00
test caddy web server
This commit is contained in:
parent
0e6ec9f616
commit
ef0af5a2f1
4 changed files with 36 additions and 4 deletions
21
Caddyfile
Normal file
21
Caddyfile
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
auto_https off
|
||||||
|
}
|
||||||
|
|
||||||
|
:80 {
|
||||||
|
@proxied path /api/* /docs /openapi.json
|
||||||
|
|
||||||
|
root * /app/dist
|
||||||
|
encode gzip
|
||||||
|
uri strip_suffix /
|
||||||
|
|
||||||
|
handle @proxied {
|
||||||
|
reverse_proxy http://127.0.0.1:9000
|
||||||
|
}
|
||||||
|
|
||||||
|
handle {
|
||||||
|
try_files {path}.html {path} /
|
||||||
|
file_server
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -7,7 +7,7 @@ RUN npm run build
|
||||||
|
|
||||||
FROM python:3.9-alpine
|
FROM python:3.9-alpine
|
||||||
|
|
||||||
RUN apk add --no-cache libxml2-dev libxslt-dev libxml2
|
RUN apk add --no-cache libxml2-dev libxslt-dev libxml2 caddy
|
||||||
ENV ENV prod
|
ENV ENV prod
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
@ -30,9 +30,11 @@ RUN apk add --update --no-cache --virtual .build-deps \
|
||||||
|
|
||||||
|
|
||||||
COPY ./mealie /app
|
COPY ./mealie /app
|
||||||
|
COPY ./Caddyfile /app
|
||||||
COPY --from=build-stage /app/dist /app/dist
|
COPY --from=build-stage /app/dist /app/dist
|
||||||
RUN rm -rf /app/test /app/.temp
|
RUN rm -rf /app/test /app/.temp
|
||||||
|
RUN chmod +x run.sh
|
||||||
|
|
||||||
VOLUME [ "/app/data/" ]
|
VOLUME [ "/app/data/" ]
|
||||||
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "80"]
|
ENTRYPOINT ["/app/run.sh"]
|
||||||
|
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "80"]
|
||||||
|
|
|
@ -53,7 +53,8 @@ def api_routers():
|
||||||
|
|
||||||
|
|
||||||
if PRODUCTION:
|
if PRODUCTION:
|
||||||
mount_static_files()
|
pass
|
||||||
|
# mount_static_files()
|
||||||
|
|
||||||
api_routers()
|
api_routers()
|
||||||
|
|
||||||
|
|
8
mealie/run.sh
Normal file
8
mealie/run.sh
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
## Migrations
|
||||||
|
# TODO
|
||||||
|
|
||||||
|
## Web Server
|
||||||
|
./caddy run --config ./Caddyfile
|
||||||
|
|
||||||
|
## Start API
|
||||||
|
uvicorn app:app --host 0.0.0.0 --port 80
|
Loading…
Add table
Add a link
Reference in a new issue