Skip to content

Instantly share code, notes, and snippets.

@carlgrundberg
carlgrundberg / deploy.sh
Created October 24, 2022 08:17
Deploy new version of container without downtime
if [ -z "$1" ]; then
echo "Service name missing"
exit 1
fi
service_name="$1"
old_container_id=$(docker-compose ps -q $service_name | tail -n1)
docker-compose pull $service_name
public static registerBinding(name:string, cls:typeof Graph):void {
ko.bindingHandlers[name] = {
init: (element:HTMLElement, valueAccessor:() => any):void => {
$(element).data(name, new cls(element, valueAccessor));
},
update: (element:HTMLElement, valueAccessor:() => any):void => {
$(element).data(name).update(element, valueAccessor);
}
};
@carlgrundberg
carlgrundberg / docker-lep
Created November 24, 2014 10:58
Docker config for LEP-enviorment. Ubuntu + Nginx + PHP
FROM ubuntu:14.04
MAINTAINER Menmo <teknik@menmo.se>
# Keep upstart from complaining
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -sf /bin/true /sbin/initctl
# Let the container know that there is no tty
ENV DEBIAN_FRONTEND noninteractive
@carlgrundberg
carlgrundberg / docker-lemp
Last active August 29, 2015 14:09
Dockerfile for LEMP setup, Ubuntu + Nginx + Mysql + PHP
FROM ubuntu:14.04
MAINTAINER Menmo <teknik@menmo.se>
# Keep upstart from complaining
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -sf /bin/true /sbin/initctl
# Let the container know that there is no tty
ENV DEBIAN_FRONTEND noninteractive