-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
47 lines (40 loc) · 1.17 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
FROM python:3.8-buster
# Install Inkscape
RUN apt-get update \
&& apt-get -y install inkscape unzip
# Install Node
RUN mkdir /node
WORKDIR /node
ENV NODE_VERSION 8.17.0
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) ARCH='x64';; \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
i386) ARCH='x86';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner
# Copy the app files
COPY ./api /app
COPY ./frontend /frontend
# Build and install the frontend
WORKDIR /frontend
RUN npm install \
&& npm run build \
&& cp -rf /frontend/build /app
# Install the python app
WORKDIR /app
RUN pip3 install -r requirements.txt
# Cleanup
RUN rm -rf /usr/local/bin/node \
&& rm -rf /usr/local/bin/npm \
&& rm -rf /node \
&& rm -rf /frontend
WORKDIR /app
EXPOSE 8000
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]