You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -14,26 +12,30 @@ The details provided assume that the official Docker daemon is running in the ba
14
12
**Suggested:** If using ohmyzsh (http://ohmyz.sh/), add the docker-compose plugin to the .zshrc for better command-line aliases and integration.
15
13
16
14
**Important:**_By default, docker will run the services in the context of
17
-
`RAILS_ENV=development`_, and there is no valid AWS configuration. You can
18
-
copy the included `.env.example` to `.env` and override these things if desired.
15
+
`RAILS_ENV=development`_. All environment variables are handled in the `docker-compose.yml` file or you may copy `docker-compose.override.yml-example` to `docker-compose.override.yml` to add additional docker configuration.
19
16
20
17
**Important:** It's a known issue that Java, in docker images built for x86, ran through Apple's Rosetta2 for M1 chips cause constant errors & crashes.
21
18
The `docker-compose.yml` has a `build` option for Blazegraph and FCrepo. If you're using an M1 mac you should comment out the `image` section and uncomment the `build` ones for these services.
22
19
This will build those images from the `m1` directory, which are copy+paste's from their respective GitHub repos, with the only change being selecting the armv8 base image version.
23
20
24
21
### Docker notes
25
22
23
+
Here are some useful docker commands that may be relevant to you
24
+
26
25
-`$ docker system prune` : A command that will reclaim disk space by deleting stopped containers, networks, dangling images and build cache.
27
26
-`$ docker volume ls` : Show a list of named volumes which hold persistent data for containers.
28
27
-`$ docker volume rm [VOLUME NAME]` : Remove a named volume, to force the system to rebuild and start that services persistent data from scratch.
28
+
And here are some useful docker-compose commands
29
+
-`$ docker compose up server -d` : Start just the development environment
30
+
-`$ docker compose down` : Stop all environments
31
+
-`$ docker compose logs -f server` : Follow the logs from just the rails application
29
32
30
-
Development Workflow
31
-
---
33
+
## Development Workflow
32
34
33
35
### Starting from scratch
34
36
35
37
You shouldn't need to do these steps often, but you **should** read them and
36
-
understand them. A "fresh start" can be necessary at times, especially when
38
+
understand them. A "fresh start" can be necessary at times, especially when
37
39
getting back to OD2 after a lot of development has taken place by others.
This file contains configuration you may expect and even require for typical
78
-
development. Feel free to tweak and override base settings here; this file is
75
+
development. Feel free to tweak and override base settings here; this file is
79
76
meant to hold all the custom environment that's particular to individual
80
77
developers.
81
78
@@ -96,17 +93,16 @@ _Open another terminal window (unless you run the previous command `detached`)._
96
93
On the first time building and starting the server, or any time you destroy the
97
94
stack's data volumes, Hyrax defaults must be created and loaded:
98
95
99
-
*("docker-compose exec" only works if the server is running. The first-run
100
-
command only works if the server has already been initialized. **Make sure
101
-
migrations have finished running** before you do these steps.)*
96
+
_("docker-compose exec" only works if the server is running. The first-run
97
+
command only works if the server has already been initialized. **Make sure
98
+
migrations have finished running** before you do these steps.)_
102
99
103
100
```bash
104
101
docker-compose exec server ./build/firstrun.sh
105
102
```
106
103
107
-
This will take a few minutes. Once it's done, you can visit
108
-
`http://localhost:3000/users/sign_in?locale=en` and log in as
109
-
"admin@example.org" with the password "admin123".
104
+
This will take a few minutes. Once it's done, you can visit
105
+
`http://localhost:3000/users/sign_in?locale=en` to
110
106
111
107
### Manual setup
112
108
@@ -131,8 +127,7 @@ Return to the server container shell session, start Rails console, create an `ad
131
127
132
128
Login to the app, and continue configuration or depositing works using the Hyrax UI.
133
129
134
-
Testing workflow
135
-
---
130
+
## Testing workflow
136
131
137
132
Testing the application amounts to running all of the required services along side an instance of the application and then running the testing framework against those containers. All of the `*-test` services have applicable environment variables injected to the containers during boot.
138
133
@@ -153,11 +148,10 @@ Start a session, and run `rspec` on the test (application) container. _(This met
153
148
154
149
docker-compose exec test rspec
155
150
156
-
Do *not* use `docker-compose run` - it will fire up the entrypoint script,
151
+
Do _not_ use `docker-compose run` - it will fire up the entrypoint script,
157
152
which starts up Puma for the capybara tests.
158
153
159
-
Additional Notes
160
-
---
154
+
## Additional Notes
161
155
162
156
### Controlling Workers
163
157
@@ -179,4 +173,3 @@ It may behoove you to create an alias for this kind of thing:
0 commit comments