Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AURA
dashboard-clock
Commits
38ac797b
Commit
38ac797b
authored
May 06, 2021
by
david
Browse files
Initial docker config.
#12
parent
71ba9946
Changes
3
Hide whitespace changes
Inline
Side-by-side
.dockerignore
0 → 100644
View file @
38ac797b
.git
node_modules
dist
Dockerfile
0 → 100644
View file @
38ac797b
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
run.sh
View file @
38ac797b
...
...
@@ -11,7 +11,7 @@ docker="false"
# - build
#
if
[[
$*
=
~ ^
(
dev|build
)
$
]]
;
then
if
[[
$*
=
~ ^
(
dev|build
|push
)
$
]]
;
then
mode
=
$1
fi
...
...
@@ -42,14 +42,38 @@ if [[ $docker == "false" ]]; then
npm run build
fi
fi
# +++ DOCKER COMMANDS +++ #
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
\ No newline at end of file
david
@david
mentioned in issue
#12 (closed)
·
May 06, 2021
mentioned in issue
#12 (closed)
mentioned in issue #12
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment