dashy/Dockerfile

30 lines
679 B
Docker
Raw Normal View History

2021-06-03 23:40:34 +03:00
# build stage
FROM node:lts-alpine as build-stage
WORKDIR /app
2021-06-03 23:40:34 +03:00
COPY package*.json ./
RUN yarn install --frozen-lockfile
COPY . .
RUN yarn build
2021-06-03 23:40:34 +03:00
# production stage
FROM alpine:3.11
ENV USER darkhttpd
ENV GROUP darkhttpd
ENV GID 911
ENV UID 911
ENV PORT 8080
2021-06-03 23:40:34 +03:00
RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
apk add -U --no-cache su-exec darkhttpd
2021-06-03 23:40:34 +03:00
COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets
COPY entrypoint.sh /entrypoint.sh
EXPOSE ${PORT}
2021-06-03 23:40:34 +03:00
VOLUME /www/assets
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]