Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| using System.Collections.Generic; | |
| using System.Web.Http; | |
| using Newtonsoft.Json; | |
| using Newtonsoft.Json.Converters; | |
| using Newtonsoft.Json.Serialization; | |
| using Owin; | |
| using Swashbuckle.Application; | |
| namespace Project | |
| { |
| FROM debian | |
| RUN apt-get update && apt-get install -y apache2 | |
| EXPOSE 80 443 | |
| CMD ["apache2ctl", "-D FOREGROUND"] |
| #Dockerfile for building an nginx development container | |
| FROM debian | |
| RUN apt-get update | |
| RUN apt-get install curl vim git nginx -y | |
| EXPOSE 80 | |
| WORKDIR /etc/nginx |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: <NAME> | |
| # Required-Start: $local_fs $network $named $time $syslog | |
| # Required-Stop: $local_fs $network $named $time $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Description: <DESCRIPTION> | |
| ### END INIT INFO |
| #!/bin/bash | |
| SERVICE_FILE=$(tempfile) | |
| echo "--- Download template ---" | |
| wget -q -O "$SERVICE_FILE" 'https://gist.githubusercontent.com/robzhu/2772bc0d8cb05e45d639/raw/c6cbfe996431d9e4f9224bdec0208eb19b0e45c1/service.sh' | |
| chmod +x "$SERVICE_FILE" | |
| echo "" | |
| echo "--- Customize ---" |
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure(2) do |config| | |
| config.vm.box = "ubuntu/trusty64" | |
| config.vm.network "private_network", ip: "192.168.10.101" | |
| config.vm.provider "virtualbox" do |vb| | |
| vb.memory = 2048 | |
| vb.cpus = 2 | |
| end | |
| config.vm.provision "shell", inline: <<-SHELL |
| import sleep from 'sleep-promise'; | |
| class DispatchQueue { | |
| constructor(rateLimitInSeconds) { | |
| this.rateLimit = rateLimitInSeconds * 1000; | |
| this.queueSize = 0; | |
| } | |
| async dispatch(call) { | |
| this.queueSize++; |
| function createSourceEventStream( | |
| schema: GraphQLSchema, | |
| document: DocumentNode, | |
| rootValue?: mixed, | |
| contextValue?: mixed, | |
| variableValues?: ?{[key: string]: mixed}, | |
| operationName?: ?string, | |
| fieldResolver?: ?GraphQLFieldResolver<any, any> | |
| ): Promise<AsyncIterable<mixed>> { | |
| return new Promise((resolve, reject) => { |
| const { | |
| GraphQLSchema, | |
| GraphQLObjectType, | |
| GraphQLString, | |
| GraphQLList, | |
| } = require('graphql'); | |
| const helloType = new GraphQLObjectType({ | |
| name: 'helloType', | |
| fields: () => ({ |