Skip to content

Commit

Permalink
Merge pull request #21 from DEFRA/feature/dev-cleanup
Browse files Browse the repository at this point in the history
sorting build and docker stuff out
  • Loading branch information
teddmason authored Jan 4, 2024
2 parents 482fcaf + d098538 commit 0e6ce3a
Show file tree
Hide file tree
Showing 8 changed files with 5,379 additions and 6,535 deletions.
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ LABEL author="Department for Environment, Food & Rural Affairs"
#ENV NODE_ENV=production
ENV PORT=8000

WORKDIR /app
COPY package*.json ./
RUN npm install

WORKDIR /usr/src
COPY . .
RUN npm run build
RUN npm install

EXPOSE $PORT

Expand Down
40 changes: 0 additions & 40 deletions Makefile

This file was deleted.

36 changes: 28 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,51 @@

# Prerequisites

Please install [Brew](https://brew.sh/) as package manager to install all dependencies for the solution,.
NodeJS v18 needs to be installed locally along with npm.

After that please execute the following in a shell command in the root of the solution:
# Getting started

Install dependencies and build the application via

```sh
$ make
$ npm i
```

# Run tests

# Getting started
```sh
$ npm test
```

# Build backend and start services

```sh
$ docker-compose -f docker/backend-services.yml up -d
```

To start the application `dev` environment please run:
# Start application

```sh
$ make start
$ npm run dev
or
$ npm run start
```

# Testing Docker build of the image

To test the creation on the Docker image please run:
To create docker image of service:

```sh
$ make build-image
$ docker build -t smart-incident-reporting:latest .
```

# Starting application in docker

```sh
$ docker-compose -f docker/service.yml up -d
```


## Project structure

Here's the default structure for your project files.
Expand Down
File renamed without changes.
20 changes: 20 additions & 0 deletions docker/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "3.9"
# secrets:
# WEBAPP_ENV:
# file: ./secrets/WEBAPP_ENV
services:
##############################################################################################################
# Biodiversity net gain service - Application to register webapp - web app found on localhost:3000
##############################################################################################################
webapp:
image: smart-incident-reporting:${TAG:-latest}
ports:
- "8000:8000"
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
# secrets:
# - WEBAPP_ENV
entrypoint: [ '/bin/sh', '-c', "npm run start" ]
# extra_hosts:
# - "host.docker.internal:host-gateway"
Loading

0 comments on commit 0e6ce3a

Please sign in to comment.