-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile-light
83 lines (71 loc) · 3.53 KB
/
Dockerfile-light
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
######## Dockerfile for Archivy Built On Alpine Linux ########
# #
#####################################################################
# CONTAINERISED ARCHIVY BUILT ON TOP OF ALPINE LINUX #
#####################################################################
# The only difference between `Dockerfile-light` and `Dockerfile` #
# is that #
# this image comes with a more lightweight configuration for #
# use with ripgrep #
#####################################################################
FROM python:3.9-alpine
# Archivy version
ARG VERSION
# ARG values for injecting metadata during build time
# NOTE: When using ARGS in a multi-stage build, remember to redeclare
# them for the stage that needs to use it. ARGs last only for the
# lifetime of the stage that they're declared in.
ARG BUILD_DATE
ARG VCS_REF
# Archivy version
ARG VERSION
# Installing xdg-utils and pandoc
RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& apk update && apk add --no-cache \
build-base \
ripgrep \
libxml2-dev \
libxslt-dev \
&& pip3.9 install archivy==$VERSION \
# Creating non-root user and group for running Archivy
&& addgroup -S -g 1000 archivy \
&& adduser -h /archivy -g "User account for running Archivy" \
-s /sbin/nologin -S -D -G archivy -u 1000 archivy \
# Creating directory in which Archivy's files will be stored
# (If this directory isn't created, Archivy exits with a "permission denied" error)
&& mkdir -p /archivy/data \
&& mkdir -p /archivy/.local/share/archivy \
# Changing ownership of all files in user's home directory
&& chown -R archivy:archivy /archivy
# Copying pre-generated config.yml from host
COPY --chown=archivy:archivy config-lite.yml /archivy/.local/share/archivy/config.yml
# Run as user 'archivy'
USER archivy
# Exposing port 5000
EXPOSE 5000
# System call signal that will be sent to the container to exit
STOPSIGNAL SIGTERM
ENTRYPOINT ["archivy"]
# The 'run' CMD is required by the 'entrypoint.sh' script to set up the Archivy server.
# Any command given to the 'docker container run' will override the CMD below.
CMD ["run"]
# Labels
LABEL org.opencontainers.image.vendor="Uzay G" \
org.opencontainers.image.authors="https://github.com/Uzay-G" \
org.opencontainers.image.title="Archivy" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.url="https://github.com/archivy/archivy-docker" \
org.label-schema.vcs-url="https://github.com/archivy/archivy-docker" \
org.opencontainers.image.documentation="https://github.com/archivy/archivy-docker/" \
org.opencontainers.image.source="https://github.com/archivy/archivy-docker/blob/main/Dockerfile-light" \
org.opencontainers.image.description="Archivy is a self-hosted knowledge repository that \
allows you to safely preserve useful content that contributes to your knowledge bank." \
org.opencontainers.image.created=$BUILD_DATE \
org.label-schema.build-date=$BUILD_DATE \
org.opencontainers.image.revision=$VCS_REF \
org.label-schema.vcs-ref=$VCS_REF \
org.opencontainers.image.version=$VERSION \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0" \
software.author.repository="https://github.com/archivy/archivy" \
software.release.version=$VERSION