-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
80 lines (54 loc) · 1.45 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM debian:12
RUN apt-get update -y && apt-get install -y \
build-essential \
curl \
git \
libbz2-dev \
libffi-dev \
liblzma-dev \
libpq-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
zlib1g-dev
RUN git clone --depth 1 https://github.com/asdf-vm/asdf.git ~/.asdf
RUN echo "source $HOME/.asdf/asdf.sh" >> /root/.bashrc
ENV PATH="$PATH:/root/.asdf/bin"
WORKDIR /root
## Install backend system dependencies
RUN asdf plugin add python
RUN asdf install python 3.11.4
RUN asdf global python 3.11.4
## Build the backend
COPY pyproject.toml poetry.lock /app/
WORKDIR /app
env PATH="$PATH:/root/.asdf/shims"
env PATH=/root/.asdf/installs/python/3.11.4/bin/:$PATH
RUN asdf plugin add poetry
RUN asdf install poetry 1.6.0
RUN asdf global poetry 1.6.0
RUN poetry install
COPY server /app/server
COPY app.py /app/
## Install frontend system dependencies
RUN asdf plugin add nodejs
RUN asdf install nodejs 16.20.2
RUN asdf global nodejs 16.20.2
RUN asdf plugin add yarn
RUN asdf install yarn 1.22.19
RUN asdf global yarn 1.22.19
## Install frontend dependencies
COPY package.json yarn.lock /app/
RUN yarn install --frozen-lockfile
COPY src /app/src
COPY public /app/public
## Build the frontend
RUN yarn build
ENV FLASK_ENV 'development'
ENV REACT_APP_SERVER_URL 'http://localhost:5000'
# ENV LANG 'C.UTF-8'
# ENV LC_ALL C.UTF-8
# ENV CLOUDINARY_URL ''
WORKDIR /app
EXPOSE 5000
# CMD ["poetry", "run", "gunicorn", "app", "-b", "0.0.0.0:5000"]