-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
35 lines (32 loc) · 1.17 KB
/
Dockerfile
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
FROM node:14-buster as base
# Create project directory
WORKDIR /opt/cric/frontend
# Install app dependencies
COPY package*.json ./
RUN npm install --production && npm cache clean --force
# Set PATH
ENV PATH /opt/cric/frontend/node_modules/.bin:$PATH
# Expose port. Otherwise, we will have "This site can’t be reached"
# https://stackoverflow.com/a/46779529
EXPOSE 4200
LABEL version="2.10.9-base" \
description="Frontend in Angular for CRIC Searchable Image Database" \
maintainer="[email protected]"
FROM base as development
RUN npm install && npm cache clean --force
LABEL version="2.10.9-development"
FROM development as builder
ARG CRIC_DOMAIN="https://database.cric.com.br"
ARG CRIC_API_DOMAIN="https://api.database.cric.com.br"
ARG CRIC_EMAIL="[email protected]"
ARG CRIC_PLAYGROUND=false
COPY . ./
RUN ng build --prod --build-optimizer
LABEL version="2.10.9-builder"
# Build a small nginx image with static website
FROM nginx:alpine as production
COPY nginx.conf /etc/nginx/nginx.conf
# --from sets the source location to a previous build stage
COPY --from=builder /opt/cric/frontend/dist/cric /usr/share/nginx/html
EXPOSE 80
LABEL version="2.10.1-production"