public-pool-ui/Dockerfile
Seth For Privacy c2c7f2d3b7
Fix Docker builds and improve Dockerfile (#22)
* Fix Docker builds and improve Dockerfile

* Use latest bookworm-slim image for Node

* Properly name final image

* Use LTS Node version instead of latest
2024-11-25 11:27:53 -05:00

36 lines
816 B
Docker

############################
# Docker build environment #
############################
FROM node:lts-bookworm-slim AS build
# Upgrade all packages and install dependencies
RUN apt-get update \
&& apt-get upgrade -y
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3 \
build-essential \
&& apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /build
COPY . .
# Build Public Pool UI using NPM
RUN npm i && npm run build
############################
# Docker final environment #
############################
FROM caddy:alpine AS final
EXPOSE 80
WORKDIR /var/www/html
COPY --from=build /build/dist/public-pool-ui .
COPY docker/Caddyfile.tpl /etc/Caddyfile.tpl
COPY docker/entrypoint.sh /entrypoint.sh
CMD ["/bin/sh", "/entrypoint.sh"]