Skip to content

Commit

Permalink
feat(docker): add Dockerfile && docker-compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
shahabganji authored and 3cp committed Sep 12, 2019
1 parent 61f3ada commit 4ed59ab
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
35 changes: 27 additions & 8 deletions skeleton/common/Dockerfile__if_docker
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# build stage
FROM node:12 as build

RUN npm install -g aurelia-cli

// @if feat.cypress || feat.protractor || feat.karma
ENV DEBIAN_FRONTEND=noninteractive

Expand Down Expand Up @@ -50,24 +48,35 @@ RUN curl --silent --show-error --location --fail --retry 3 --output /tmp/google-

// @endif

RUN npm install -g aurelia-cli@1.1.0


WORKDIR /app

# install dependencies
COPY ./*.json ./
RUN npm install

# copy other files
COPY ./*.config.js ./
COPY ./*.ejs ./
COPY ./*.ico ./
COPY config ./config
COPY aurelia_project ./aurelia_project

# COPY application
// @if feat.typescript && feat.webpack
COPY types ./types
// @endif

// @if feat.webpack
COPY static ./static
// @endif

# Copy files in the root folder
COPY *.* ./

# Copy source files
COPY src ./src


// @if feat.cypress || feat.protractor || feat.jest || feat.karma
# Copy test, unit & e2e
COPY test ./test
// @endif

Expand All @@ -81,7 +90,6 @@ RUN au test
RUN npm run e2e:headless
// @endif


# build
FROM build as publish
RUN au build
Expand All @@ -90,7 +98,18 @@ RUN au build
FROM nginx:alpine as run-time
COPY nginx.conf /etc/nginx/nginx.conf
WORKDIR /usr/share/nginx/html
// @if feat.webpack
COPY --from=publish /app/dist/ .
// @endif

// @if feat["cli-bundler"]
// @if feat["scaffold-navigation"]
COPY --from=publish /app/bootstrap/dist/ ./bootstrap/dist/
// @endif
COPY --from=publish /app/scripts/ ./scripts/
COPY --from=publish /app/index.html/ .
// @endif

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
8 changes: 8 additions & 0 deletions skeleton/common/docker-compose.yml__if_docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3.7"

services:
/* @echo projectName */:
image: /* @echo projectName */:0.1.0
ports:
- "5050:80"
restart: unless-stopped

0 comments on commit 4ed59ab

Please sign in to comment.