forked from bocabitlabs/buho-stocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
40 lines (30 loc) · 1.22 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
32
33
34
35
36
37
38
39
40
FROM tiangolo/uwsgi-nginx:python3.10
EXPOSE 8000 3000
# https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/common.md
COPY .devcontainer/library-scripts/common-debian.sh /tmp/library-scripts/
RUN apt-get update && bash /tmp/library-scripts/common-debian.sh
RUN apt-get update
RUN apt-get -y install curl gnupg
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get -y install nodejs
RUN npm install
RUN npm install --global yarn
# set work directory
WORKDIR /usr/src/app
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH "${PYTHONPATH}:/usr/src:/workspace/backend"
ENV LISTEN_PORT 8000
# install dependencies
RUN pip install --upgrade pip
COPY ./requirements.txt /usr/src
RUN pip install --no-cache-dir --upgrade -r /usr/src/requirements.txt
RUN mkdir /usr/src/media/
RUN mkdir /usr/src/logs/
# copy project
COPY ./backend /usr/src/app
COPY ./data/db.sqlite3.base /usr/src/data/db.sqlite3
RUN mv /usr/src/app/config/config.sample.py /usr/src/app/config/config.py
RUN python manage.py collectstatic
RUN sed -i -e "s/REPLACE_SECRET_KEY/$(od -x /dev/urandom | head -1 | awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}')/g" /usr/src/app/config/config.py