-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker): add initila docker files & setup for the cli
- Loading branch information
1 parent
8a4ceeb
commit 9ea4c54
Showing
4 changed files
with
136 additions
and
2 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
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
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# build stage | ||
FROM node:12 as build | ||
|
||
RUN npm install -g aurelia-cli | ||
|
||
// @if feat.cypress || feat.protractor || feat.karma | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
#update apt-get | ||
RUN apt-get update | ||
|
||
RUN apt-get install -y \ | ||
apt-utils \ | ||
fonts-liberation \ | ||
libappindicator3-1 \ | ||
libatk-bridge2.0-0 \ | ||
libatspi2.0-0 \ | ||
libgtk-3-0 \ | ||
libnspr4 \ | ||
libnss3 \ | ||
libx11-xcb1 \ | ||
libxtst6 \ | ||
lsb-release \ | ||
xdg-utils \ | ||
libgtk2.0-0 \ | ||
libnotify-dev \ | ||
libgconf-2-4 \ | ||
libnss3 \ | ||
libxss1 \ | ||
libasound2 \ | ||
xvfb | ||
|
||
# cypress dependencies or use cypress/base images | ||
RUN apt-get install -y \ | ||
libgtk2.0-0 \ | ||
libnotify-dev \ | ||
libgconf-2-4 \ | ||
libnss3 \ | ||
libxss1 \ | ||
libasound2 \ | ||
xvfb | ||
|
||
# install chrome | ||
RUN curl --silent --show-error --location --fail --retry 3 --output /tmp/google-chrome-stable_current_amd64.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ | ||
&& ( dpkg -i /tmp/google-chrome-stable_current_amd64.deb || apt-get -fy install) \ | ||
&& rm -rf /tmp/google-chrome-stable_current_amd64.deb \ | ||
&& sed -i 's|HERE/chrome"|HERE/chrome" --disable-setuid-sandbox --no-sandbox|g' \ | ||
"/opt/google/chrome/google-chrome" \ | ||
&& google-chrome --version | ||
|
||
// @endif | ||
|
||
WORKDIR /app | ||
|
||
# install dependencies | ||
COPY ./*.json ./ | ||
RUN npm install | ||
|
||
# copy other files | ||
COPY ./*.config.js ./ | ||
COPY ./*.ejs ./ | ||
COPY ./*.ico ./ | ||
COPY aurelia_project ./aurelia_project | ||
|
||
# COPY application | ||
COPY types ./types | ||
COPY static ./static | ||
COPY src ./src | ||
|
||
// @if feat.cypress || feat.protractor || feat.jest || feat.karma | ||
COPY test ./test | ||
// @endif | ||
|
||
// @if feat.jest || feat.karma | ||
# RUN UNIT TESTS | ||
RUN au test | ||
// @endif | ||
|
||
// @if feat.cypress || feat.protractor | ||
# RUN E2E TESTS | ||
RUN npm run e2e:headless | ||
// @endif | ||
|
||
|
||
# build | ||
FROM build as publish | ||
RUN au build | ||
|
||
# run-time stage | ||
FROM nginx:alpine as run-time | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
WORKDIR /usr/share/nginx/html | ||
COPY --from=publish /app/dist/ . | ||
EXPOSE 80 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
worker_processes 1; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
include /etc/nginx/mime.types; | ||
|
||
gzip on; | ||
gzip_min_length 1000; | ||
gzip_proxied expired no-cache no-store private auth; | ||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} | ||
} |