Skip to content

Commit

Permalink
Merge pull request #297 from digital-land/fix/trello-3443-docker-comp…
Browse files Browse the repository at this point in the history
…ose-security-setup

Fix for Trello #3443: Corrected Docker Compose setup for Security Scanning
  • Loading branch information
ssadhu-sl authored Sep 20, 2024
2 parents a4dc0dd + 303cdeb commit 060944e
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env.dev.docker
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ENVIRONMENT="development"
DATABASE_URL="postgres://postgres:postgres@db/digital_land"
PRE_START_PATH=/src/prestart-dev.sh
PRE_START_PATH=/src/prestart.sh
PORT=8000
RELOAD="true"
WEB_CONCURRENCY=1
2 changes: 2 additions & 0 deletions .github/workflows/security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:

- name: setup
run: |
npm install
make frontend-all
sudo curl -SL https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker pull ${DOCKER_REPO}/${APPLICATION}:${DOCKER_APPLICATION_TAG}
Expand Down
2 changes: 1 addition & 1 deletion assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $govuk-new-link-styles: true;
$govuk-link-underline-offset: .2em;

// import all govuk frontend scss
@import "node_modules/govuk-frontend/govuk/all";
@import "govuk-frontend/govuk/all";

// planning.data.gov.uk specific styles
// --------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions default.paths.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"digitalLandFrontendPath": "node_modules/digital-land-frontend/",
"govukFrontendPath": "node_modules/govuk-frontend/",
"digitalLandFrontendPath": "node_modules/digital-land-frontend",
"govukFrontendPath": "node_modules/govuk-frontend/sass",
"scssPath": "./src/scss",
"templatesPath": "'application/templates'",
"staticFilesPath": "'application/static'",
Expand Down
7 changes: 6 additions & 1 deletion docker-compose.security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
build:
context: .
dockerfile: Dockerfile
target: dev
target: production
environment:
ENVIRONMENT: production
S3_HOISTED_BUCKET: https://digital-land-production-collection-dataset-hoisted.s3.eu-west-2.amazonaws.com
Expand All @@ -20,11 +20,16 @@ services:
PORT: 8000
WEB_CONCURRENCY: 1
DATA_FILE_URL: https://data.digital-land.info
RELOAD: "true"
PRE_START_PATH: "/src/prestart.sh"
volumes:
- .:/src
healthcheck:
test: curl -v -i -f http://localhost:8000
interval: 1s
timeout: 3s
retries: 60
restart: on-failure

db:
image: postgis/postgis:13-master
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ services:
target: dev
volumes:
- .:/src
- .env.test.docker:/src/.env.test
# - .env.test.docker:/src/.env.test
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
env_file: ./.env.dev.docker
environment:
DATASETTE_URL: https://datasette.digital-land.info
DATA_FILE_URL: https://data.digital-land.info
healthcheck:
test: curl -v -i -f http://localhost:8000
interval: 1s
Expand Down
2 changes: 1 addition & 1 deletion package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (fs.existsSync(optionalConfigPath)) {
}

scripts.build = {
stylesheets: `npx node-sass ${configPaths.scssPath} -o ${configPaths.stylesheetsOutputPath} --include-path ${configPaths.govukFrontendPath} --include-path ${configPaths.digitalLandFrontendPath}`,
stylesheets: `npx sass ${configPaths.scssPath}:${configPaths.stylesheetsOutputPath} --load-path=node_modules`,
}

scripts.copy = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"copyfiles": "^2.4.1",
"govuk-frontend": "4.2.0",
"maplibre-gl": "^4.1.2",
"node-sass": "^9.0.0"
"sass": "^1.78.0"
},
"devDependencies": {
"@vitest/coverage-v8": "^0.34.1",
Expand Down

0 comments on commit 060944e

Please sign in to comment.