-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
26 lines (24 loc) · 906 Bytes
/
Dockerfile
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
FROM golang:1.20-bookworm AS builder
WORKDIR /go/app
COPY . .
RUN go build -buildvcs=false
FROM redis/redis-stack-server:latest AS redis-stack
FROM redis:7-bookworm AS redis
COPY . .
COPY --from=redis-stack /opt/redis-stack/lib/redisearch.so /opt/redis-stack/lib/redisearch.so
COPY --from=builder /go/app/content-recommendation .
RUN apt-get update && apt-get install -y python3 python3-pip curl procps cron vim
ADD crontab /etc/cron.d/cronjobs
RUN chmod 0644 /etc/cron.d/cronjobs && \
crontab /etc/cron.d/cronjobs && \
touch /var/log/cron.log
RUN rm /usr/lib/python3.11/EXTERNALLY-MANAGED
RUN pip3 install pipenv
RUN pipenv install --system --deploy
CMD fallocate -l 512M /swapfile && \
chmod 0600 /swapfile && \
mkswap /swapfile && \
echo 10 > /proc/sys/vm/swappiness && \
swapon /swapfile && \
echo 1 > /proc/sys/vm/overcommit_memory && \
python3 server.py --refresh