-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (24 loc) · 994 Bytes
/
Dockerfile
File metadata and controls
31 lines (24 loc) · 994 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
FROM python:3.11
WORKDIR /
# Clone client and build it; also clean cache to ensure no strange vite build issues
RUN apt-get update && apt-get install -y git nodejs npm
RUN git clone https://github.com/simonsobs/tileviewer.git
WORKDIR /tileviewer
RUN npm cache clean --force
RUN rm -rf node_modules/.vite
RUN npm install
RUN npm run build
# Copy this repo's code into a directory called livetiler
WORKDIR /
COPY ./tilemaker livetiler/tilemaker
COPY ./pyproject.toml livetiler/pyproject.toml
# Copy client's build into livetiler's static directory, ensuring a clean copy,
# then delete client repo
WORKDIR /livetiler
RUN rm -rf tilemaker/server/static && mkdir -p tilemaker/server/static
RUN cp -r /tileviewer/dist/* tilemaker/server/static
RUN rm -rf /tileviewer
RUN pip install --no-cache-dir --upgrade .
RUN pip install --no-cache-dir --upgrade "gunicorn"
EXPOSE 8000
CMD ["gunicorn", "-k", "uvicorn.workers.UvicornWorker", "-w", "8", "tilemaker.server:app", "--bind", "0.0.0.0:8000"]