-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile-dev
31 lines (23 loc) · 1.02 KB
/
Dockerfile-dev
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 tiangolo/uvicorn-gunicorn-fastapi:python3.9
# SEE: https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker
# `json-schema-to-typescript` from npm is neccessary to run `generate_typescript_defs`
# SEE: https://github.com/phillipdupuis/pydantic-to-typescript
RUN apt-get update && apt-get install -y nodejs npm
# install json-schema-to-typescript globally
RUN npm install -g json-schema-to-typescript --save
# This is the directory where the code is located
WORKDIR /backend
# Create a virtual environment
ENV VIRTUAL_ENV=/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# copy everything from the code directory to the container
COPY . .
# neccessary for Graphviz and Erdantic
RUN apt-get install -y graphviz graphviz-dev
# run setup.py file with development mode `-e`
RUN pip --no-cache-dir install -e .[dev]
# This is not neccesary since we install all dependencies above
# RUN pip --no-cache-dir install -r requirements.txt
# RUN pip --no-cache-dir install -r requirements_dev.txt
WORKDIR /backend/app