-
Notifications
You must be signed in to change notification settings - Fork 0
/
demoweb.ps1
28 lines (19 loc) · 858 Bytes
/
demoweb.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Set to the name of the Docker machine you want to use
$DOCKER_MACHINE_NAME='default'
# Set to the name of the Docker image
$DOCKER_IMAGE_NAME='scyaq02/demoweb'
# Set to the name of the Docker container
$DOCKER_CONTAINER_NAME='demoweb'
# Set to the name of the Docker network
$DOCKER_NETWORK_NAME='demonw'
# Load our docker host's environment variables
docker-machine env $DOCKER_MACHINE_NAME --shell powershell | Invoke-Expression
cd C:\projects\Docker\RdBrainsDockerDemo\src\RDBrainsDemo.Web
if( (@(docker ps) -like "* $DOCKER_CONTAINER_NAME" ) ) {
docker stop $DOCKER_CONTAINER_NAME
}
if( (@(docker ps -a) -like "* $DOCKER_CONTAINER_NAME" ) ) {
docker rm $DOCKER_CONTAINER_NAME
}
docker build -t $DOCKER_IMAGE_NAME .
docker run -d --name $DOCKER_CONTAINER_NAME --net $DOCKER_NETWORK_NAME $DOCKER_IMAGE_NAME /usr/sbin/apache2ctl -D FOREGROUND