Skip to content
Snippets Groups Projects
Commit 38ac797b authored by David Trattnig's avatar David Trattnig
Browse files

Initial docker config. #12

parent 71ba9946
No related branches found
No related tags found
No related merge requests found
.git
node_modules
dist
FROM node:lts-alpine AS base
LABEL maintainer="David Trattnig <david.trattnig@subsquare.at>"
# Base Stage
WORKDIR /aura
COPY package*.json ./
RUN npm install
# Development Stage
FROM base AS dev
EXPOSE 5000
CMD ["./run.sh", "dev"]
# Production Stage
FROM base AS prod
COPY . .
CMD ["./run.sh", "build"]
\ No newline at end of file
...@@ -11,7 +11,7 @@ docker="false" ...@@ -11,7 +11,7 @@ docker="false"
# - build # - build
# #
if [[ $* =~ ^(dev|build)$ ]]; then if [[ $* =~ ^(dev|build|push)$ ]]; then
mode=$1 mode=$1
fi fi
...@@ -42,14 +42,38 @@ if [[ $docker == "false" ]]; then ...@@ -42,14 +42,38 @@ if [[ $docker == "false" ]]; then
npm run build npm run build
fi fi
fi fi
# +++ DOCKER COMMANDS +++ # # +++ DOCKER COMMANDS +++ #
if [[ $docker == "true" ]]; then if [[ $docker == "true" ]]; then
BASE_D=$(realpath "${BASH_SOURCE%/*}/") BASE_DIR=$(readlink -f .)
echo "Absolute base dir: " $BASE_DIR
### Start local development server ###
if [[ $mode == "dev" ]]; then
#TODO docker run command for dev server (See dev stage in Dockerfile)
echo "Missing implementation"
fi
### Create build for use in production ###
if [[ $mode == "prod" ]]; then
#TODO docker run command for prod build (See prod stage in Dockerfile)
echo "Missing implementation"
fi
### Create Docker Image from local project ###
# ~~~ 404 ~~~ if [[ $mode == "build" ]]; then
docker build -t autoradio/engine-clock .
fi
### Pushes the latest Docker Image to Docker Hub ###
if [[ $mode == "push" ]]; then
docker push autoradio/engine-clock
fi
fi fi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment