Let's use Fig to set up and run a Django/PostgreSQL app. Before starting, you'll need to have Fig installed.
Let's set up the three files that'll get us started. First, our app is going to be running inside a Docker container which contains all of its dependencies. We can define what goes inside that Docker container using a file called Dockerfile. It'll contain this to start with:
Second, we define our Python dependencies in a file called requirements.txt:
Django
+psycopg2
Simple enough. Finally, this is all tied together with a file called fig.yml. It describes the services that our app comprises of (a web server and database), what Docker images they use, how they link together, what volumes will be mounted inside the containers and what ports they expose.
If you started Fig with fig up -d, you'll probably want to stop your services once you've finished with them:
$ fig stop
-
That's more-or-less how Fig works. See the reference section below for full details on the commands, configuration file and environment variables. If you have any thoughts or suggestions, open an issue on GitHub or email us.
+
That's more-or-less how Fig works. See the reference section below for full details on the commands, configuration file and environment variables. If you have any thoughts or suggestions, open an issue on GitHub.
We're going to use Fig to set up and run a Rails/PostgreSQL app. Before starting, you'll need to have Fig installed.
Let's set up the three files that'll get us started. First, our app is going to be running inside a Docker container which contains all of its dependencies. We can define what goes inside that Docker container using a file called Dockerfile. It'll contain this to start with:
-
FROM binaryphile/ruby:2.0.0-p247
+
FROM ruby
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev
RUN mkdir /myapp
WORKDIR /myapp
@@ -127,11 +127,10 @@ myapp_web_1 | [2014-01-17 17:16:29] INFO WEBrick::HTTPServer#start: pid=1 port=