patterndockerMinor
Getting a docker build ready for (Heroku) deployment?
Viewed 0 times
dockerdeploymentgettingreadyforherokubuild
Problem
I've got a local application working using
Now I've tried getting a
Could somebody explain to me how a regular process like this would look like, and what steps a build process would walk through in docker terms?
Would I need a seperate command to package it for deployment? Is there a separate configuration required?
docker-compose up, this gets me the servers I need and they function just fine locally.Now I've tried getting a
build.sh started, but I can't figure out how to build a docker image using either docker-compose or just regular docker-cli with the final result of the build process. (The /dist/ folder).Could somebody explain to me how a regular process like this would look like, and what steps a build process would walk through in docker terms?
Would I need a seperate command to package it for deployment? Is there a separate configuration required?
Solution
For building docker image using
This example define a web service which:
host machine
container, allowing you to modify the code without having to rebuild
the image.
To build the image, simply issue the build command via docker-compose, as such:
docker-compose you can add build: field to the service you want to build and assign to it the path of the Dockerfile for example:version: '2'
services:
web:
build: .
ports:
- "8080:80"
volumes:
- /project:/var/www/htmlThis example define a web service which:
- Uses an image that’s built from the
Dockerfilein the current directory.
- Forwards the exposed port 80 on the container to port 8080 on the
host machine
- Mounts the project directory on the host to
/projectinside the
container, allowing you to modify the code without having to rebuild
the image.
To build the image, simply issue the build command via docker-compose, as such:
docker-compose build.Code Snippets
version: '2'
services:
web:
build: .
ports:
- "8080:80"
volumes:
- /project:/var/www/htmlContext
StackExchange DevOps Q#1637, answer score: 1
Revisions (0)
No revisions yet.