Skip to content

Commit

Permalink
changes for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
teddmason committed Jan 24, 2024
1 parent 7b71052 commit 5da8103
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 34 deletions.
13 changes: 0 additions & 13 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion bin/build-css → bin/build-css.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

node-sass --output-style=expanded \
--output=server/public/build/stylesheets \
Expand Down
2 changes: 1 addition & 1 deletion bin/build → bin/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh

npm run build:css
4 changes: 0 additions & 4 deletions bin/startContainer

This file was deleted.

16 changes: 4 additions & 12 deletions docker/service.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
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}
build:
context: ../
dockerfile: dockerfile
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"
- REDIS_PORT=6379
14 changes: 14 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:18-alpine

LABEL author="DEFRA"
ENV NODE_ENV=production
ENV PORT=8000

WORKDIR /usr/src
COPY . smart-incident-reporting
WORKDIR /usr/src/smart-incident-reporting
RUN npm install

EXPOSE $PORT

CMD [ "npm", "start" ]
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"scripts": {
"postinstall": "npm run build",
"start": "node index.js",
"build:css": "bin/build-css",
"build": "bin/build",
"build:css": "./bin/build-css.sh",
"build": "./bin/build.sh",
"debug": "nodemon --inspect index.js",
"watch:css": "nodemon -e scss -x 'npm run build:css'",
"watch:nodejs": "nodemon --delay 1000ms --signal SIGTERM -r dotenv/config index.js",
Expand All @@ -20,7 +20,6 @@
"unit-test": "jest --runInBand --verbose",
"test": "npm run lint && npm run unit-test",
"prettier": "prettier-config-standard",
"prepare": "husky install",
"start-backend": "docker-compose -f docker/backend-services.yml up -d",
"stop-backend": "docker-compose -f docker/backend-services.yml down"
},
Expand Down

0 comments on commit 5da8103

Please sign in to comment.