-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
46 lines (33 loc) · 1.06 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
################################################################################
# Stage 1: Generate styles & modules for the application
################################################################################
FROM node:20-alpine as build_app
ENV WORKDIR=/usr/src
RUN mkdir -p $WORKDIR
WORKDIR $WORKDIR
COPY . $WORKDIR
# Install dependencies
RUN npm install
# Build app
RUN npm run build
RUN cd static/ && npm install
RUN rm -rf $WORKDIR/.git/
RUN rm -rf $WORKDIR/node_modules/
################################################################################
# Stage 2: Run the Flask application
################################################################################
FROM python:3.12-alpine
# Install tools
RUN apk add \
bash \
curl \
nano
# Add build app
COPY --from=build_app /usr/src/ /var/www/web/
# Python requirements
COPY requirements.txt /root/python/requirements.txt
RUN pip install --upgrade -r /root/python/requirements.txt
RUN chmod +x /var/www/web/app.py
# Expose 80, 443 ports
EXPOSE 80 443
CMD ["python3", "/var/www/web/app.py"]