scribe/Dockerfile

42 lines
1.1 KiB
Text
Raw Permalink Normal View History

2021-12-16 01:23:38 +01:00
FROM node:16-alpine as node_build
2021-10-16 07:29:41 +02:00
WORKDIR /tmp_build
COPY package.json .
COPY yarn.lock .
RUN yarn install --no-progress --frozen-lockfile
COPY webpack.mix.js .
COPY src ./src
RUN yarn prod
2022-07-17 18:02:01 +02:00
FROM crystallang/crystal:1.5-alpine as lucky_build
2021-10-16 07:29:41 +02:00
ENV SKIP_LUCKY_TASK_PRECOMPILATION="1"
RUN apk add yaml-static
WORKDIR /tmp_build
COPY shard.* ./
RUN shards install --production
COPY . .
COPY --from=node_build /tmp_build/public/mix-manifest.json public/mix-manifest.json
RUN crystal build --static src/start_server.cr
RUN crystal build --static tasks.cr -o run_task
FROM alpine
ARG PUID=1000
ARG PGID=1000
RUN addgroup -g ${PGID} -S lucky && \
adduser -u ${PUID} -S lucky -G lucky
WORKDIR /home/lucky/app
COPY --chown=lucky:lucky --from=node_build /tmp_build/public public
COPY --chown=lucky:lucky --from=lucky_build /tmp_build/start_server start_server
COPY --chown=lucky:lucky --from=lucky_build /tmp_build/run_task run_task
COPY --chown=lucky:lucky ./script/docker_entrypoint ./
RUN mkdir ./config
RUN chown -R lucky /home/lucky
USER lucky
CMD ["/home/lucky/app/docker_entrypoint"]