From d1c7f2162b5328b5bf0c2ee993d1177351a78b83 Mon Sep 17 00:00:00 2001 From: Cobin Bluth Date: Sat, 22 Aug 2020 12:00:35 +0200 Subject: [PATCH] fix docker-compose --- .dockerignore | 2 ++ Dockerfile | 2 ++ docker-compose.yml | 22 ++++++++++------------ 3 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..12fe6241 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git +docker-compose.yml \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a3e31e09..4625124c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM node:12.18-alpine +ENV DATABASE_URL "postgresql://umami:umami@db:5432/umami" + COPY . /app WORKDIR /app diff --git a/docker-compose.yml b/docker-compose.yml index b09b81eb..f9560dd9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,25 +1,23 @@ -version: '3.8' +--- +version: '3' services: umami: build: . ports: - "3000:3000" environment: - DATABASE_URL: postgresql://umami:umami@postgres:5432/umami + DATABASE_URL: postgresql://umami:umami@db:5432/umami HASH_SALT: replace-me-with-a-random-string - postgres: + depends_on: + - db + db: image: postgres:alpine - ports: - - "5432:5432" environment: + POSTGRES_DB: umami POSTGRES_USER: umami POSTGRES_PASSWORD: umami volumes: - - type: bind - source: ./sql/schema.postgresql.sql - target: /docker-entrypoint-initdb.d/schema.postgresql.sql - - type: volume - source: postgres-data - target: /var/lib/postgresql/data + - ./sql/schema.postgresql.sql:/docker-entrypoint-initdb.d/schema.postgresql.sql:ro + - umami-db-data:/var/lib/postgresql/data volumes: - postgres-data: + umami-db-data: