-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP backend Dockerfiles with OS X support #3
Closed
Conversation
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
build: server | ||
command: python runserver.py -h 0.0.0.0 -p 5000 | ||
volumes: | ||
- server/:/code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is essentially the same as $PWD/server/:/code
, may not need to have two separate fig.ymls
refreshing with latest master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
server/migrations
andserver/migrations/*
from the.gitignore
as these will need to be in version control.Running the Docker Environment
Requirements
Process
sudo systemctl start docker
docker
/fig
commands withsudo
by adding yourself to the
docker
group withsudo gpasswd -a <user> docker
and then logging out and back in.boot2docker init
(only needed once)boot2docker start
(starts the VM)$(boot2docker shellinit)
(sets necessary environment variables, willwant to add this to your shell profile/rc file)
boot2docker status
[sudo] docker version
[sudo] docker run hello-world
[sudo] fig --version
[sudo] fig build
fig.yml
from the corresponding platform-specificfig file
ln -s fig.linux.yml fig.yml
ln -s fig.osx.yml fig.yml
Neu-Hatch
to
hatch
or something, Docker doesn't allow capital letters in containernames
fig
command with-p hatch
,but will get annoying.
source ENVVAR
fig up
[sudo] fig up
docker
group, you'll need to prefix thecommands with
sudo
. Since some of the environment variables in thefig.yml
are sourced from the host thatfig
is running on, you'llneed to use a small helper script that you can use
sudo
with thatwill source your
ENVVAR
file and then runfig up
fig run server python manage.py db init
fig run server python manage.py db migrate
fig run server python manage.py db upgrade
localhost:5000
$(boot2docker ip):5000
Making Changes
Backend (db and server)
data.
If you make changes to the back end code, it's easiest to do the following:
fig stop
or pressCtrl+C
in the terminal window wherefig
isrunning to stop the containers.
fig rm
to remove the old containersfig build
to build new containers with the latest changesfig up
. You will need to re-run the database migrations (migrate
and
upgrade
,init
most likely will not need to be run).Client
This is out dated as the client is moving to a separate repo
If you have the collection of containers running (
db
,server
,client
),and want to test your changes to the client code, you should do the following:
fig stop client
to stop the existingclient
containerfig rm client
to remove the existingclient
containerfig build client
to create a newclient
container with your mostrecent changes.
fig up client
to start theclient
containerTODO
5432
and5000
through containerlinking
the database will live.
Fig installed, cloning this repo, and running
fig up