Skip to content

Commit

Permalink
Wrap to container, minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed Feb 28, 2020
1 parent a5c5320 commit 173383c
Show file tree
Hide file tree
Showing 7 changed files with 196 additions and 128 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*
!src
!config.js
!LICENSE
!package.json
!package-lock.json
!readme.md
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Build node_modules to avoid installing NPM (additinal container size)

FROM alpine AS stage

WORKDIR /app
COPY . /app

RUN apk add --update npm=12.15.0-r1
RUN npm install

# Build aclual container

FROM alpine

COPY . /app
COPY --from=stage /app/node_modules /app/node_modules
WORKDIR /app

RUN apk add --update nodejs=12.15.0-r1

EXPOSE 80

ENV APP__ENV_NAME=prod
CMD node -r esm src/api.js
13 changes: 13 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

HUB=zitros/analytics-saviour

docker build --rm -t image .

if [ $# -eq 1 ]
then
docker tag image $HUB:$1
fi
docker tag image $HUB:latest

docker push $HUB
Loading

0 comments on commit 173383c

Please sign in to comment.