diff --git a/Dockerfile b/Dockerfile index 77dd374..ae7b6e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,10 @@ -FROM microsoft/dotnet:2.1.500-sdk-alpine3.7 as version +FROM microsoft/dotnet:2.2.102-sdk-stretch as version WORKDIR /src COPY .git ./ -RUN apk add libcurl --no-cache && \ - dotnet tool install -g minver-cli --version 1.0.0-beta.1 && \ +RUN dotnet tool install -g minver-cli --version 1.0.0-beta.2 && \ /root/.dotnet/tools/minver > .version FROM node:10.12.0-alpine AS build @@ -34,16 +33,4 @@ RUN \ echo "@sqlstreamstore:registry=https://www.myget.org/F/sqlstreamstore/npm/" >> .npmrc && \ yarn publish --new-version $(cat .version) --no-git-tag-version ;\ else echo "No API key found, skipping publishing..." ;\ - fi - -FROM nginx:1.15.5-alpine AS runtime - -WORKDIR /etc/nginx - -COPY ./nginx/ ./ - -COPY --from=publish /app/dist/ /var/www/ - -EXPOSE 80 - -ENTRYPOINT ["nginx", "-g", "daemon off;"] + fi \ No newline at end of file diff --git a/build.sh b/build.sh index 87a12c8..1ac81e0 100755 --- a/build.sh +++ b/build.sh @@ -2,44 +2,6 @@ set -e -LOCAL_IMAGE="sql-stream-store-browser" -LOCAL="${LOCAL_IMAGE}:latest" - -REMOTE_IMAGE="sqlstreamstore/browser" - docker build \ --build-arg MYGET_API_KEY=$MYGET_API_KEY \ - --tag ${LOCAL} \ . - -VERSION=$(docker run --entrypoint=cat ${LOCAL} /var/www/.version) - -SEMVER_REGEX="^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$" - -[[ $VERSION =~ $SEMVER_REGEX ]] - -MAJOR="${REMOTE_IMAGE}:${BASH_REMATCH[1]}" -MAJOR_MINOR="${REMOTE_IMAGE}:${BASH_REMATCH[1]}.${BASH_REMATCH[2]}" -MAJOR_MINOR_PATCH="${REMOTE_IMAGE}:${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}" -MAJOR_MINOR_PATCH_PRE="${REMOTE_IMAGE}:${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}${BASH_REMATCH[4]}" - -if [[ -n $TRAVIS_TAG && -z ${BASH_REMATCH[4]} ]]; then - echo "Detected a tag with no prerelease." - docker tag $LOCAL $MAJOR_MINOR_PATCH - docker tag $LOCAL $MAJOR_MINOR - if [[ ${BASH_REMATCH[1]} != "0" ]]; then - docker tag $LOCAL $MAJOR - else - echo "Detected unstable version." - fi -else - echo "Detected a prerelease." - docker tag $LOCAL $MAJOR_MINOR_PATCH_PRE -fi - -if [[ -n $DOCKER_USER ]]; then - echo "${DOCKER_PASS}" | docker login --username "${DOCKER_USER}" --password-stdin - docker push $REMOTE_IMAGE -fi - -docker images --filter=reference="${REMOTE_IMAGE}" \ No newline at end of file diff --git a/nginx/mime.types b/nginx/mime.types deleted file mode 100644 index 3ea871c..0000000 --- a/nginx/mime.types +++ /dev/null @@ -1,4 +0,0 @@ -types { - application/javascript js; - text/html html htm shtml; -} \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf deleted file mode 100644 index 69416c4..0000000 --- a/nginx/nginx.conf +++ /dev/null @@ -1,87 +0,0 @@ -worker_processes 4; - -events { worker_connections 1024; } - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - # Speed up file transfers by using sendfile() to copy directly - # between descriptors rather than using read()/write(). - sendfile on; - - # Tell Nginx not to send out partial frames; this increases throughput - # since TCP frames are filled up before being sent out. (adds TCP_CORK) - tcp_nopush on; - - # Tell Nginx to enable the Nagle buffering algorithm for TCP packets, which - # collates several smaller packets together into one larger packet, thus saving - # bandwidth at the cost of a nearly imperceptible increase to latency. (removes TCP_NODELAY) - tcp_nodelay off; - - # Compression - - # Enable Gzip compressed. - gzip on; - - # Enable compression both for HTTP/1.0 and HTTP/1.1 (required for CloudFront). - gzip_http_version 1.0; - - # Compression level (1-9). - # 5 is a perfect compromise between size and cpu usage, offering about - # 75% reduction for most ascii files (almost identical to level 9). - gzip_comp_level 5; - - # Don't compress anything that's already small and unlikely to shrink much - # if at all (the default is 20 bytes, which is bad as that usually leads to - # larger files after gzipping). - gzip_min_length 256; - - # Compress data even for clients that are connecting to us via proxies, - # identified by the "Via" header (required for CloudFront). - gzip_proxied any; - - # Tell proxies to cache both the gzipped and regular version of a resource - # whenever the client's Accept-Encoding capabilities header varies; - # Avoids the issue where a non-gzip capable client (which is extremely rare - # today) would display gibberish if their proxy gave them the gzipped version. - gzip_vary on; - - # Compress all output labeled with one of the following MIME-types. - gzip_types - application/atom+xml - application/javascript - application/json - application/rss+xml - application/vnd.ms-fontobject - application/x-font-ttf - application/x-web-app-manifest+json - application/xhtml+xml - application/xml - font/opentype - image/svg+xml - image/x-icon - text/css - text/plain - text/x-component; - - server { - listen 80; - server_name localhost; - - root /var/www/; - index index.html; - - # Health check endpoint. This will be used by kubernetes to determine if the - # container is ready/alive. - location = /_healthz { - return 200 'OK'; - } - - # Force all paths to load either itself (js files) or go through index.html. - location / { - try_files $uri /index.html; - add_header Vary 'Accept, Accept-Encoding'; - } - } -} \ No newline at end of file diff --git a/package.json b/package.json index 863b0c6..107cebd 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,10 @@ "files": [ "dist", "README.md", - "src" + "src", + "*.json", + "yarn.lock", + "public/*" ], "private": false, "devDependencies": {