-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (40 loc) · 2.09 KB
/
Dockerfile
File metadata and controls
48 lines (40 loc) · 2.09 KB
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
# App image for KWALLM - Text analysis with LLM
# Contains application code on top of base image
# We use a base image (built from Dockerfile.base) to separate the
# installation of dependencies from the application code, allowing for
# faster rebuilds & pulls from registry when only application code changes
# To build this image fully locally (base + app), run:
# docker build -f Dockerfile.base -t kwallm-base:local .
# docker build -f Dockerfile -t kwallm-app:local --build-arg BASE_IMAGE=kwallm-base:local .
ARG BASE_IMAGE=ghcr.io/kennispunttwente/tekstanalyse_met_llm-base:base-latest
FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title="KWALLM: Text analysis with LLM" \
org.opencontainers.image.version="See version tag at https://github.com/KennispuntTwente/KWALLM/pkgs/" \
org.opencontainers.image.description="Application for (automated) qualitative text analysis with large language models (LLMs)." \
org.opencontainers.image.authors="Luka Koning <l.koning@kennispunttwente.nl>" \
org.opencontainers.image.licenses="AGPL-3.0-only" \
org.opencontainers.image.vendor="Kennispunt Twente" \
org.opencontainers.image.source="https://github.com/KennispuntTwente/KWALLM" \
org.opencontainers.image.base.name="ghcr.io/kennispunttwente/tekstanalyse_met_llm-base"
ENV TZ=Europe/Amsterdam \
OMP_NUM_THREADS=1 \
HF_HUB_OFFLINE=1
USER root
# Application files
WORKDIR /home/appuser/app
COPY --chown=appuser:appuser R/ R/
COPY --chown=appuser:appuser Dockerfile-app.R app.R
COPY --chown=appuser:appuser www/ www/
COPY --chown=appuser:appuser language/ language/
COPY --chown=appuser:appuser LICENSE.md LICENSE.md
COPY --chown=appuser:appuser package.json package.json
COPY --chown=appuser:appuser pyproject.toml pyproject.toml
COPY --chown=appuser:appuser uv.lock uv.lock
COPY --chown=appuser:appuser KWALLM.Rproj KWALLM.Rproj
# Switch to non-root user
RUN chown -R appuser:appuser /home/appuser/app && \
chmod -R u+rwX /home/appuser/app
USER appuser
# Expose and run
CMD ["Rscript", "-e", "shiny::runApp('/home/appuser/app', host='0.0.0.0', port=3838)"]
EXPOSE 3838