Skip to content

Commit

Permalink
Update Docker build process (#1022)
Browse files Browse the repository at this point in the history
* Fix docker file builds to use debian
* add a few more things to `.dockerignore`
* remove unused `martin` from docker-compose.yml
* delete unused arm64.Dockerfile

This should also fix #1021
  • Loading branch information
nyurik authored Nov 24, 2023
1 parent e4c3138 commit d311888
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 68 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ Dockerfile
justfile
# Remove self from the image too
.dockerignore
# Unneeded code
**/tests
demo/

#### This must match .gitignore ####
.DS_Store
target/
**/*.rs.bk
.idea/
.vscode/
test_log*
*.profraw

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# ATTENTION: This is an autogenerated file. See original at
# https://github.com/maplibre/martin/blob/main/.github/templates/homebrew.martin.rb.j2
# https://github.com/maplibre/martin/blob/main/.github/files/homebrew.martin.rb.j2
#

class Martin < Formula
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ jobs:
# https://github.com/docker/build-push-action
with:
context: .
file: multi-platform.Dockerfile
file: .github/files/multi-platform.Dockerfile
load: true
tags: ${{ github.repository }}:linux-arm64
platforms: linux/arm64
Expand All @@ -191,7 +191,7 @@ jobs:
# https://github.com/docker/build-push-action
with:
context: .
file: multi-platform.Dockerfile
file: .github/files/multi-platform.Dockerfile
load: true
tags: ${{ github.repository }}:linux-amd64
platforms: linux/amd64
Expand Down Expand Up @@ -227,7 +227,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: multi-platform.Dockerfile
file: .github/files/multi-platform.Dockerfile
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
Expand Down Expand Up @@ -630,7 +630,7 @@ jobs:
- name: Create Homebrew formula
uses: cuchi/jinja2-action@master
with:
template: .github/templates/homebrew.martin.rb.j2
template: .github/files/homebrew.martin.rb.j2
output_file: target/homebrew/martin.rb
data_file: target/homebrew_config.yaml

Expand Down
23 changes: 0 additions & 23 deletions Dockerfile

This file was deleted.

23 changes: 0 additions & 23 deletions arm64.Dockerfile

This file was deleted.

29 changes: 29 additions & 0 deletions demo/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#### This must match .dockerignore ####

# dependencies
frontend/node_modules

# testing
frontend/coverage

# production
frontend/build
frontend/dist

db/initdb/taxi_zones
db/initdb/taxi_trips

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

.idea
data
db/db
2 changes: 1 addition & 1 deletion demo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
#### This must match .dockerignore ####

# dependencies
frontend/node_modules
Expand Down
11 changes: 0 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
version: "3"

services:
martin:
image: ghcr.io/maplibre/martin:v0.8.7
restart: unless-stopped
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgres://postgres:postgres@db/db
- RUST_LOG=actix_web=info,martin=debug,tokio_postgres=debug
depends_on:
- db

db-is-ready:
# This should match the version of postgres used in the CI workflow
image: postgis/postgis:14-3.3-alpine
Expand Down
3 changes: 2 additions & 1 deletion docs/src/run-with-docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: '3'

services:
martin:
image: ghcr.io/maplibre/martin:v0.8.7
image: ghcr.io/maplibre/martin:v0.11.1
restart: unless-stopped
ports:
- "3000:3000"
Expand All @@ -24,6 +24,7 @@ services:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
volumes:
# persist PostgreSQL data in a local directory outside of the docker container
- ./pg_data:/var/lib/postgresql/data
```
Expand Down
4 changes: 0 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,6 @@ coverage FORMAT='html': (cargo-install "grcov")
open "$OUTPUT_RESULTS_DIR/index.html"
fi

# Build martin docker image
docker-build:
docker build -t ghcr.io/maplibre/martin .

# Build and run martin docker image
docker-run *ARGS:
docker run -it --rm --net host -e DATABASE_URL -v $PWD/tests:/tests ghcr.io/maplibre/martin {{ ARGS }}
Expand Down

0 comments on commit d311888

Please sign in to comment.