-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-scribe
47 lines (37 loc) · 1.44 KB
/
Dockerfile-scribe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM node:16-alpine as node_build
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
FROM 84codes/crystal:latest-alpine as lucky_build
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"]
# labels according to https://github.com/opencontainers/image-spec/blob/main/annotations.md
LABEL org.opencontainers.image.url https://github.com/FarisZR/Privacy-OCI
LABEL org.opencontainers.image.licenses AGPL-3.0
LABEL org.opencontainers.image.title Scribe
LABEL org.opencontainers.image.description "Auto updated Container for Scribe, A privacy proxy for Medium.com and Github gists"