mirror of
https://github.com/benjamin-wilson/public-pool-ui.git
synced 2025-03-17 05:13:02 +01:00
* Fix Docker builds and improve Dockerfile * Use latest bookworm-slim image for Node * Properly name final image * Use LTS Node version instead of latest
36 lines
816 B
Docker
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"]
|