aboutsummaryrefslogtreecommitdiff
path: root/plugins/ObjectCacheServer/server/container/Dockerfile
blob: 6c466d49cb10f77a11430182b6b7abbb2ab9619d (plain)
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
#Copyright (c) Vaughn Nugent
#Licensed under the GNU AGPL V3.0

#use plain alpine latest to build native libraries in
FROM alpine:3.19 as native-cont

#install public libs and build tools
RUN apk update && apk add build-base cmake npm
#most universal way to use Task is from NPM
RUN npm install -g @go-task/cli

WORKDIR /build
 
#include local artifacts
COPY app/ .

#build internal libraries and copy the libraries to the /lib output directory
RUN mkdir out/
RUN task build-libs

#APP CONTAINER
#move into a clean dotnet apline lean image
FROM mcr.microsoft.com/dotnet/runtime:8.0.2-alpine3.19-amd64 as app-cont

LABEL name="vnuge/vncache"
LABEL maintainer="Vaughn Nugent <vnpublic@proton.me>"
LABEL description="A simple clustered network data caching service"

#copy local artifacts again in run container
COPY app/ /app

#pull compiled libs from build container
COPY --from=native-cont /build/out /app/lib

RUN apk update && apk add --no-cache gettext icu-libs dumb-init

#workdir 
WORKDIR /app

#default to 2557 for cache port
EXPOSE 2557/tcp

VOLUME /app/ssl
#expose an assets directory for custom assets install
VOLUME /app/usr/assets

#disable dotnet invariant culture on alpine
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=0

#add helper/required libraries
#ENV VNLIB_SHARED_HEAP_FILE_PATH=/app/lib/libvn_rpmalloc.so		not ready yet, still need to debug

#cache varables
ENV MAX_ENTRIES=10000
ENV CACHE_BUCKETS=100
ENV CACHE_MAX_MESSAGE=20480
ENV MAX_CONCURRENT_CONNECTIONS=1000

ENV VERIFY_IP=true
ENV MAX_PEER_NODES=10
ENV DISCOVERY_INTERVAL=360
ENV CACHE_CONNECT_PATH="/cache"
ENV DISCOVER_PATH="/discover"
ENV KNOWN_PEERS=[]

#HC Vault
ENV HC_VAULT_ADDR=""
ENV HC_VAULT_TOKEN=""
ENV HC_VAULT_TRUST_CERT=false

#SECRETS
ENV CACHE_PRIV_KEY=""
ENV CLIENT_PUB_KEY=""

#HTTP/PROXY Config
ENV HTTP_DOWNSTREAM_SERVERS=[]
ENV HTTP_MAX_CONNS=5000

#run the init script within dumb-init
ENTRYPOINT ["dumb-init", "--"]
CMD ["ash", "./run.sh"]