forked from coldfront/coldfront
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathContainerfile
More file actions
48 lines (32 loc) · 969 Bytes
/
Containerfile
File metadata and controls
48 lines (32 loc) · 969 Bytes
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
FROM registry.cloud.rt.nyu.edu/nyu-rts/ubi/ubi9
LABEL name="coldfront" \
vendor="NYU RTS" \
description="For production use to deploy Coldfront in RTC"
# Build Python as superuser!
RUN dnf install -y python3.12 && dnf update -y
COPY . /app
RUN chown -R 1001:0 /app && \
chmod -R g+rwx /app
USER 1001
# Enable bytecode compilation
ENV UV_COMPILE_BYTECODE=1
# Copy from the cache instead of linking since it's a mounted volume
ENV UV_LINK_MODE=copy
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
WORKDIR /app
RUN mkdir -p /tmp/uv
# Need this to prevent os13 errors on shipwright.
ENV UV_CACHE_DIR=/tmp/uv
RUN uv sync --locked --extra prod
# Default port for gunicorn
EXPOSE 8000
# Remove when we get users, but keep it for testing for now
ENV PYTHONUNBUFFERED=1
EXPOSE 5678
RUN chown -R 1001:0 /tmp/uv && \
chmod -R g=u /tmp/uv
# Terrible hack for now :(
USER 0
RUN chown -R 1001:0 /app && \
chmod -R g+rwx /app
USER 1001