forked from iizukanao/node-rtsp-rtmp-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request iizukanao#61 from TheNotary/dockerization
adds docker deployment option
- Loading branch information
Showing
4 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM node:4-onbuild | ||
|
||
################ | ||
# App Deps # | ||
################ | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
# TODO: | ||
# Copy over your application stuff required to load up | ||
# dependencies and then install those dependencies | ||
|
||
ADD package.json /app/package.json | ||
RUN npm install -d | ||
RUN npm install -g coffee-script | ||
|
||
|
||
################ | ||
# App Source # | ||
################ | ||
|
||
# Copy over your apps sourcecode in this section | ||
COPY . /app/ | ||
|
||
|
||
############# | ||
# Conclude # | ||
############# | ||
|
||
COPY entrypoint.sh /sbin/entrypoint.sh | ||
RUN chmod +x /sbin/entrypoint.sh | ||
RUN echo ". /sbin/entrypoint.sh" > /root/.bash_history | ||
|
||
ENTRYPOINT ["/sbin/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
DOCKER_IMAGE_NAME = node-rtsp-rtmp-server | ||
|
||
build: | ||
docker build -t ${USER}/${DOCKER_IMAGE_NAME} . | ||
|
||
# If you have to configure volumes, do that from here | ||
# configure: | ||
|
||
run: | ||
(docker start ${DOCKER_IMAGE_NAME}) || \ | ||
docker run \ | ||
-p 80:80 -p 1935:1935 \ | ||
--name ${DOCKER_IMAGE_NAME} -d ${USER}/${DOCKER_IMAGE_NAME} | ||
|
||
console: | ||
docker run -it \ | ||
-p 80:80 -p 1935:1935 \ | ||
-e an_env_var=${HIDDEN_ENV} \ | ||
${USER}/${DOCKER_IMAGE_NAME} bash | ||
|
||
.PHONY: build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Boot any servers you need to | ||
bash -l -c "coffee /app/server.coffee &" | ||
|
||
|
||
# Spawn bash if we're booting in console mode | ||
if [ "$1" = 'bash' ]; then | ||
/bin/bash | ||
exit | ||
fi | ||
|
||
# This line keeps the container alive | ||
tail -f /var/log/dmesg |