-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e75e72b
commit 049920a
Showing
1 changed file
with
7 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
# Stage 0, "build-stage", based on Node.js, to build and compile the frontend | ||
FROM node:10 as build-stage | ||
|
||
# set working dir | ||
WORKDIR /app | ||
|
||
# Set the package files first, so they can be cached | ||
COPY client/package*.json ./ | ||
ARG REPOSITORY_URL=https://github.com/OpenSlides/openslides-client.git | ||
ARG GIT_CHECKOUT=master | ||
RUN git clone --no-checkout -- $REPOSITORY_URL . | ||
RUN git checkout $GIT_CHECKOUT | ||
|
||
# install npm dependencies, should be cached | ||
WORKDIR /app/client | ||
RUN npm install | ||
|
||
# Copy the angular client code | ||
COPY client/ ./ | ||
|
||
# compile the angular project | ||
RUN npm run build | ||
|
||
# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx | ||
FROM nginx:latest | ||
|
||
# Copy the compildes app to nginx | ||
COPY --from=build-stage /app/dist /usr/share/nginx/html | ||
COPY --from=build-stage /app/client/dist /usr/share/nginx/html | ||
|
||
# Copy the nginx.conf | ||
COPY nginx/nginx.conf /etc/nginx/nginx.conf | ||
COPY --from=build-stage /app/nginx/nginx.conf /etc/nginx/nginx.conf |