Skip to content

Commit

Permalink
Delete docker build wrapper and update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jim committed Oct 3, 2023
1 parent 9755cb0 commit 1260c43
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 33 deletions.
45 changes: 17 additions & 28 deletions DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,31 @@ The following commands should just be run for the initial setup only. Rebuilding
the docker images is only necessary when upgrading, if there are changes to the
Dockerfile, or if gems or npm packages have been added or updated.
1. Install [Docker Community Edition](https://docs.docker.com/install/) if it
is not already installed.
3. Clone the respository to your local machine: `git clone
https://github.com/rubyforgood/circulate.git` or create a fork in GitHub if
you don't have permission to commit directly to this repo.
4. Change into the application directory: `cd circulate`
5. Run `./docker-build.sh` to build images for all services.
6. Run `docker-compose up -d database` to start the database service.
7. Run `docker-compose run --rm web rails db:reset` to create the dev and test
is not already installed, or you can try [Orbstack](https://orbstack.dev) or
[colima](https://github.com/abiosoft/colima) if you're using a Mac.
3. Clone the respository to your local machine and change into the application
directory: `cd circulate`.
5. Run `docker-compose up -d database` to start the database service.
6. Run `docker-compose run --rm web rails db:reset` to create the dev and test
databases, load the schema, and run the seeds file.
8. Run `docker-compose up -d` to start all the remaining services.
9. Run `docker-compose ps` to view status of the containers. All should have
7. Run `docker-compose up -d` to start all the remaining services.
8. Run `docker-compose ps` to view status of the containers. All should have
state "Up". Check the [logs](#viewing-logs) if there are any containers that
did not start.
10. The web application will be available at http://chicago.circulate.local:3000 or [localhost:3000](http://localhost:3000).
9. The web application will be available at [localhost:3000](http://localhost:3000).

## For ongoing development:
1. Run `docker-compose up -d` to start all services.
1. Run `docker-compose up -d --force-recreate` to start services with new
2. Run `docker-compose up -d --force-recreate` to start services with new
containers.
1. Run `./docker-build.sh` to build a new image for the web service.
After re-building an image, run `docker-compose up -d --force-recreate web`
3. Run `docker-compose up -d --force-recreate web`
to start a container running the new image.
5. Run `docker-compose ps` to view status of containers.
1. Run `docker-compose stop` to stop all services.
1. Run `docker-compose rm <service>` to remove a stopped container.
1. Run `docker-compose rm -f <service>` to force remove a stopped container.
1. Run `docker-compose restart web` to restart the web server.
4. Run `docker-compose down -v` to stop and remove all containers, as well as
4. Run `docker-compose ps` to view status of containers.
5. Run `docker-compose stop` to stop all services.
6. Run `docker-compose rm <service>` to remove a stopped container.
7. Run `docker-compose rm -f <service>` to force remove a stopped container.
8. Run `docker-compose restart web` to restart the web server.
9. Run `docker-compose down -v` to stop and remove all containers, as well as
volumes and networks. This command is helpful if you want to start with a
clean slate. However, it will completely remove the database and you will
need to go through the database setup steps again above.
Expand All @@ -54,14 +51,6 @@ running `docker-compose build web` first. If you have been making gem updates
to your container without rebuilding the image, then the one-off container will
be out of date.

### Running webpack dev server
To speed compiling of assets, run the webpack dev server in a separate terminal
window:

```
$ docker-compose exec web bin/webpack-dev-server
```

### Viewing logs
To view the logs, run:
```
Expand Down
5 changes: 0 additions & 5 deletions docker-build.sh

This file was deleted.

0 comments on commit 1260c43

Please sign in to comment.