@@ -48,7 +48,7 @@ ARG CI_COMMIT_SHA=dev
48
48
49
49
# - Intermediary stages
50
50
# * build-node
51
- FROM node:16 AS build-node
51
+ FROM --platform=$TARGETPLATFORM node:16 AS build-node
52
52
53
53
# Copy the files required to install npm packages
54
54
WORKDIR /app
@@ -66,25 +66,25 @@ RUN cd frontend && ENV=${ENV} npm ci --quiet --production
66
66
COPY frontend /app/frontend
67
67
68
68
# * build-node-django [build-node]
69
- FROM build-node as build-node-django
69
+ FROM --platform=$TARGETPLATFORM build-node as build-node-django
70
70
71
71
RUN mkdir /app/api && cd frontend && npm run bundledjango
72
72
73
73
# * build-node-selfhosted [build-node]
74
- FROM build-node as build-node-selfhosted
74
+ FROM --platform=$TARGETPLATFORM build-node as build-node-selfhosted
75
75
76
76
RUN cd frontend && npm run bundle
77
77
78
78
# * build-python
79
- FROM python:3.11 as build-python
79
+ FROM --platform=$TARGETPLATFORM python:3.11 as build-python
80
80
WORKDIR /app
81
81
82
82
COPY api/pyproject.toml api/poetry.lock api/Makefile ./
83
83
ENV POETRY_VIRTUALENVS_CREATE=false POETRY_HOME=/usr/local
84
84
RUN make install opts='--without dev'
85
85
86
86
# * build-python-private [build-python]
87
- FROM build-python AS build-python-private
87
+ FROM --platform=$TARGETPLATFORM build-python AS build-python-private
88
88
89
89
# Authenticate git with token, install SAML binary dependency,
90
90
# private Python dependencies, and integrate private modules
@@ -98,7 +98,7 @@ RUN --mount=type=secret,id=github_private_cloud_token \
98
98
make install-private-modules
99
99
100
100
# * api-runtime
101
- FROM python:3.11-slim as api-runtime
101
+ FROM --platform=$TARGETPLATFORM python:3.11-slim as api-runtime
102
102
103
103
WORKDIR /app
104
104
@@ -119,7 +119,7 @@ CMD ["migrate-and-serve"]
119
119
120
120
# - Target (shippable) stages
121
121
# * private-cloud-api [api-runtime, build-python-private]
122
- FROM api-runtime as private-cloud-api
122
+ FROM --platform=$TARGETPLATFORM api-runtime as private-cloud-api
123
123
124
124
COPY --from=build-python-private /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
125
125
COPY --from=build-python-private /usr/local/bin /usr/local/bin
@@ -130,7 +130,7 @@ RUN touch ./ENTERPRISE_VERSION
130
130
USER nobody
131
131
132
132
# * private-cloud-unified [api-runtime, build-python-private, build-node-django]
133
- FROM api-runtime as private-cloud-unified
133
+ FROM --platform=$TARGETPLATFORM api-runtime as private-cloud-unified
134
134
135
135
COPY --from=build-node-django /app/api/static /app/static
136
136
COPY --from=build-node-django /app/api/app/templates/webpack /app/app/templates/webpack
@@ -143,7 +143,7 @@ RUN touch ./ENTERPRISE_VERSION
143
143
USER nobody
144
144
145
145
# * saas-api [api-runtime, build-python-private]
146
- FROM api-runtime as saas-api
146
+ FROM --platform=$TARGETPLATFORM api-runtime as saas-api
147
147
148
148
# Install GnuPG and import private key
149
149
RUN --mount=type=secret,id=sse_pgp_pkey \
@@ -161,7 +161,7 @@ RUN touch ./SAAS_DEPLOYMENT
161
161
USER nobody
162
162
163
163
# * oss-api [api-runtime, build-python]
164
- FROM api-runtime as oss-api
164
+ FROM --platform=$TARGETPLATFORM api-runtime as oss-api
165
165
166
166
COPY --from=build-python /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
167
167
COPY --from=build-python /usr/local/bin /usr/local/bin
@@ -171,7 +171,7 @@ RUN python manage.py collectstatic --no-input
171
171
USER nobody
172
172
173
173
# * oss-frontend [build-node-selfhosted]
174
- FROM node:16-slim AS oss-frontend
174
+ FROM --platform=$TARGETPLATFORM node:16-slim AS oss-frontend
175
175
176
176
USER node
177
177
WORKDIR /srv/bt
@@ -187,7 +187,7 @@ EXPOSE 8080
187
187
CMD ["node" , "./api/index.js" ]
188
188
189
189
# * oss-unified [build-python, build-node-django]
190
- FROM api-runtime as oss-unified
190
+ FROM --platform=$TARGETPLATFORM api-runtime as oss-unified
191
191
192
192
COPY --from=build-node-django /app/api/static /app/static/
193
193
COPY --from=build-node-django /app/api/app/templates/webpack /app/app/templates/webpack
0 commit comments