Skip to content

Commit

Permalink
Dockerfile accepts git checkouts
Browse files Browse the repository at this point in the history
  • Loading branch information
FinnStutzenstein committed Feb 28, 2020
1 parent e75e72b commit 049920a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Dockerfile
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

0 comments on commit 049920a

Please sign in to comment.