-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathDockerfile.func
More file actions
69 lines (50 loc) · 1.56 KB
/
Dockerfile.func
File metadata and controls
69 lines (50 loc) · 1.56 KB
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
ARG BUILD_IMAGE=mcr.microsoft.com/azure-functions/node:4-node22-appservice
ARG SERVE_IMAGE=mcr.microsoft.com/azure-functions/python:4-python3.11-appservice
# Set Production Build Flag
ARG PROD_BUILD=true
FROM $BUILD_IMAGE AS builder
# Production Build Flag
ARG PROD_BUILD
# Set Debian Frontend Flag
ARG DEBIAN_FRONTEND=noninteractive
# Disable NPM Update Notifications
ENV NPM_CONFIG_UPDATE_NOTIFIER=false
# Set the Working Directory
WORKDIR /tmp
# Copy UI Code
COPY ./ui/. ./
# Install UI Dependencies
RUN if [ "${PROD_BUILD}" = true ]; then \
npm ci; \
else \
npm install; \
fi
RUN chmod 777 -R node_modules
# Build IPAM UI
RUN npm run build
FROM $SERVE_IMAGE
# Set Production Build Flag
ARG PROD_BUILD
# Set Debian Frontend to Non-Interactive
ARG DEBIAN_FRONTEND=noninteractive
# Set Azure Function Root Directory & Enable Console Logging
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
# Disable PIP Root Warnings
ENV PIP_ROOT_USER_ACTION=ignore
# Set Working Directory
WORKDIR /tmp
# Copy Requirements File
COPY ./engine/requirements.txt .
COPY ./engine/requirements.lock.txt .
# Upgrade PIP
RUN pip install --upgrade pip --progress-bar off
# Install Dependencies
RUN if [ "${PROD_BUILD}" = true ]; then \
pip install --no-cache-dir -r ./requirements.lock.txt --progress-bar off; \
else \
pip install --no-cache-dir -r ./requirements.txt --progress-bar off; \
fi
# Copy Application Code to Function App Root Directory
COPY ./engine/. /home/site/wwwroot
COPY --from=builder /tmp/dist /home/site/wwwroot/dist