-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (49 loc) · 1.64 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (49 loc) · 1.64 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
ARG BE_NAMESPACE=xchem
ARG BE_IMAGE_TAG=latest
ARG FE_NAMESPACE=xchem
ARG FE_IMAGE_TAG=latest
ARG STACK_NAMESPACE=xchem
ARG STACK_VERSION=0.0.0
# Start with the frontend container image AS 'frontend'.
# As part of the build we will copy the contents of its '/frontend' directory
# into the backend image that we also pull in.
FROM ${FE_NAMESPACE}/fragalysis-frontend:${FE_IMAGE_TAG} AS frontend
# We have to repeat the ARG assignments...
# ARGs are reset during the FROM action
# See https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
# Us
ARG STACK_NAMESPACE
ARG STACK_VERSION
# Backend image identity
ARG BE_NAMESPACE
ARG BE_IMAGE_TAG
# Frontend image identity
ARG FE_NAMESPACE
ARG FE_IMAGE_TAG
# Get the backend image
# (we'll copy the pre-compiled frontend into it)
FROM ${BE_NAMESPACE}/fragalysis-backend:${BE_IMAGE_TAG}
# We have to repeat the ARG assignments...
ARG STACK_NAMESPACE
ARG STACK_VERSION
ARG BE_NAMESPACE
ARG BE_IMAGE_TAG
ARG FE_NAMESPACE
ARG FE_IMAGE_TAG
# Set the container ENV to record the origin of the b/e and f/e
# (for diagnostic purposes)
ENV BE_NAMESPACE=${BE_NAMESPACE}
ENV BE_IMAGE_TAG=${BE_IMAGE_TAG}
ENV FE_NAMESPACE=${FE_NAMESPACE}
ENV FE_IMAGE_TAG=${FE_IMAGE_TAG}
ENV STACK_NAMESPACE=${STACK_NAMESPACE}
ENV STACK_VERSION=${STACK_VERSION}
ENV APP_ROOT=/code
# Copy the frontend code from the frontend container
WORKDIR ${APP_ROOT}/frontend
WORKDIR ${APP_ROOT}/static
COPY --from=frontend /frontend ${APP_ROOT}/frontend
RUN ln -s ${APP_ROOT}/frontend/bundles/ ${APP_ROOT}/static/bundles
WORKDIR ${APP_ROOT}
# The entrypoint is a responsibility of the backend image
CMD ["./docker-entrypoint.sh"]