-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
42 lines (32 loc) · 1.34 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Use the official Python image as the base image
FROM python:3.11
# Set environment variables (This overwrites all defualts in the app)
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE=api.settings
# Set the working directory in the container
WORKDIR /anoncat/
# Install system dependencies
RUN apt-get update && \
apt-get install -y nodejs npm build-essential vim bash wget
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Copy the requirements file into the container
COPY requirements.txt /anoncat/
# Install the required Python packages
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code into the container
COPY anoncat /anoncat/
# Run the command to build frontend assets using Webpack
WORKDIR /anoncat/deidentify_app/
RUN npm install .
RUN npx webpack --config webpack.config.js
# Download the default Anoncat model (message me for models)
#RUN wget -O deid_medcat_n2c2_modelpack.zip https://medcat.rosalind.kcl.ac.uk/media/deid_medcat_n2c2_modelpack.zip && \
# unzip deid_medcat_n2c2_modelpack.zip -d deidentify_app/models/
# Collect static files (if needed)
WORKDIR /anoncat/
RUN python manage.py migrate
RUN python manage.py collectstatic --noinput