Skip to content
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

get docker-compose working on windows #1

Merged
merged 1 commit into from
Mar 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,19 @@ On Windows the OTM source code is shared with the virtual machine via a one-way


## Running with Docker

Everything can be run using the `docker-compose.yml`, but with a few changes.

### restore a database backup

Download a database dump from the S3 backups. Then, use `psql` to import the database dump into a the running postgres container.

Example:

```
psql -h localhost -U otm -d otm <~/20210308.dump
```

There are a few changes that need to be made:
* The volumes for nginx need to be updated. Both nginx and otm-core need to share a local volume for the static and media directories
* The otm-core and otm-tiler hostname in the nginx configs should be updated to localhost
Expand Down
2 changes: 1 addition & 1 deletion configs/etc/nginx/includes/upstreams/app
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
upstream app {
server localhost:12000;
server otm-core:12000;
}
2 changes: 1 addition & 1 deletion configs/etc/nginx/includes/upstreams/tiler
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
upstream tile {
server localhost:4000;
server otm-tiler:4000;
}
8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'
services:
nginx:
image: nginx:latest
network_mode: "host"
restart: always
volumes:
- ./configs/etc/nginx/sites-available:/etc/nginx/sites-available
- ./configs/etc/nginx/sites-enabled:/etc/nginx/sites-enabled
Expand All @@ -11,6 +11,8 @@ services:
- ./configs/etc/nginx/includes:/etc/nginx/includes
- ${HOME}/tools/docker/volumes/otm/static:/usr/local/otm/static
- ${HOME}/tools/docker/volumes/otm/media:/usr/local/otm/media
ports:
- '8080:8080'

database:
image: kartoza/postgis:9.6-2.4
Expand Down Expand Up @@ -62,8 +64,8 @@ services:
- '12000:12000'
# - '3000:3000'
volumes:
- ${HOME}/tools/docker/volumes/otm/static:/usr/local/otm/static
- ${HOME}/tools/docker/volumes/otm/media:/usr/local/otm/media
- ${HOME}/tools/docker/volumes/otm/static:/usr/local/otm/app/static
- ${HOME}/tools/docker/volumes/otm/media:/usr/local/otm/app/media

# otm-celery:
# image: otm-core:1.0
Expand Down
2 changes: 1 addition & 1 deletion nginx/configs/etc/nginx/includes/upstreams/app
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
upstream app {
server localhost:12000;
server otm-core:12000;
}
2 changes: 1 addition & 1 deletion nginx/configs/etc/nginx/includes/upstreams/tiler
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
upstream tile {
server localhost:4000;
server otm-tiler:4000;
}
2 changes: 1 addition & 1 deletion nginx/configs/etc/nginx/sites-available/otm.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include includes/upstreams/*;

server {
listen 80 default_server;
listen 8080 default_server;

client_max_body_size 20M;

Expand Down