-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (37 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
51 lines (37 loc) · 1.04 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
49
50
51
# syntax=docker/dockerfile:1
FROM node:22-slim AS build
WORKDIR /code
COPY package.json package-lock.json eslint.config.mjs /code/
COPY src/web /code/src/web
RUN npm install && npm run build
FROM python:3.12-alpine
ENV HOMEDIR=/code \
APP_USER=rationarr \
LANGUAGE=C.UTF-8 \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
LC_CTYPE=C.UTF-8 \
LC_MESSAGES=C.UTF-8 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/code
RUN addgroup -g 1000 ${APP_USER} && \
adduser -h ${HOMEDIR} -G ${APP_USER} -u 1000 -D ${APP_USER}
# gcc libffi postgresql musl
RUN apk add --no-cache tzdata curl
RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
WORKDIR $HOMEDIR
COPY pyproject.toml README.md ./
RUN pip install --no-cache-dir -e .
COPY src/app/ ./app/
COPY alembic/ ./alembic/
COPY alembic.ini .
COPY --from=build /code/src/web/out ./dist
COPY <<-EOT /entrypoint.sh
#!/bin/sh
alembic upgrade head
uvicorn app.main:app --host 0.0.0.0 --proxy-headers --port 8000 --workers 4
EOT
RUN chmod +x /entrypoint.sh
USER ${APP_USER}
EXPOSE 8000
ENTRYPOINT ["/entrypoint.sh"]