1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-25 08:09:41 +02:00
mealie/frontend/Dockerfile
2021-08-07 20:21:44 -08:00

47 lines
1 KiB
Docker

FROM node:lts as builder
WORKDIR /app
COPY . .
# Install Caddy
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
curl \
apt-transport-https \
&& 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 /etc/apt/sources.list.d/caddy-stable.list \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
caddy
RUN yarn install \
--prefer-offline \
--frozen-lockfile \
--non-interactive \
--production=false
RUN yarn build
RUN rm -rf node_modules && \
NODE_ENV=production yarn install \
--prefer-offline \
--pure-lockfile \
--non-interactive \
--production=true
FROM node:15-alpine
WORKDIR /app
# copying caddy into image
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
COPY ./Caddyfile /app
COPY --from=builder /app .
ENV HOST 0.0.0.0
EXPOSE 3000
RUN ["caddy", "start", "--config", "/app/Caddyfile"]
CMD [ "yarn", "start" ]