Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
717da8d1
Unverified
Commit
717da8d1
authored
6 years ago
by
Alexander Rose
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #3 from rcsb/dev-CC-Docker
Dev cc docker
parents
5a80def1
484420bb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+17
-15
17 additions, 15 deletions
Dockerfile
README.md
+2
-2
2 additions, 2 deletions
README.md
with
19 additions
and
17 deletions
Dockerfile
+
17
−
15
View file @
717da8d1
...
...
@@ -3,15 +3,18 @@
# Source material: https://derickbailey.com/2017/05/31/how-a-650mb-node-js-image-for-docker-uses-less-space-than-a-50mb-image/
# Source material: https://hub.docker.com/_/node/
### Builder Stage (Multi-Stage Docker Build)
# Use the slimed NodeJS source, yielding a space savings of 600MB (~66% of total)
FROM
node:alpine
FROM
node:alpine
as
builder
ENV
NODEROOT /usr/src/app/
# Create app directory
WORKDIR
/usr/src/app
WORKDIR
$NODEROOT
# Install app dependencies
# A wildcard is used to ensure
both package.json AND package-lock.json AND tslint.json AND tsconfig.json
are copied
# where available (npm@5+)
# A wildcard is used to ensure
the following
are copied
#
package.json AND package-lock.json AND tslint.json AND tsconfig.json are copied
where available (npm@5+)
COPY
*.json ./
# Install all dependencies and copy results
...
...
@@ -21,17 +24,16 @@ COPY . .
# Build library and canvas application then copy results
RUN
npm run build
RUN
npm run build-canvas
COPY
build/canvas/ build/canvas/
# Open ports for HTTP
EXPOSE
8080/tcp
COPY
. .
# Setup standalone simple webserver to run the demo
RUN
npm
install
http-server
-g
### Runtime Stage (Multi-Stage Docker Build)
FROM
httpd:2.4
as
runtime
ENV
NODEROOT /usr/src/app
ENV
HTTPDROOT /usr/local/apache2/htdocs/
# Start NodeJS at container stand up
CMD
[ "http-server", "build/canvas/", "-p", "8080" ]
## Code must be placed into /usr/local/apache2/htdocs/
WORKDIR
$HTTPDROOT
COPY
--from=builder $NODEROOT/build/canvas/ .
# Developer helpers (what is inside this container?)
RUN
node
-v
RUN
ls
-alh
# Open ports for HTTP
EXPOSE
80
This diff is collapsed.
Click to expand it.
README.md
+
2
−
2
View file @
717da8d1
...
...
@@ -83,11 +83,11 @@ and navigate to `build/viewer`
Build the docker image
docker build -t molstar
-
proto .
docker build -t molstar
/
proto
:httpd
.
Run the image
docker run -p 80
80:80
80 molstar
-
proto
docker run
-d
-p 80
:
80 molstar
/
proto
:httpd
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment