Skip to content

Commit

Permalink
Merge pull request #93 from DEFRA/fix/DOC-1432-add-devcontainer
Browse files Browse the repository at this point in the history
Added devcontainer config
  • Loading branch information
suityou01 authored Sep 10, 2024
2 parents c02f805 + bbc12e5 commit 514b0a9
Show file tree
Hide file tree
Showing 7 changed files with 238 additions and 16 deletions.
134 changes: 134 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose
{
"name": "ffc-pay-web",

// Update the 'dockerComposeFile' list if you have more compose files or use different names.
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
"dockerComposeFile": [
"../docker-compose.yaml",
"docker-compose.yml"
],

// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "ffc-pay-web",

// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-docker",
"orta.vscode-jest",
"andys8.jest-snippets",
"ms-ossdata.vscode-postgresql",
"asyncapi.asyncapi-preview",
"oderwat.indent-rainbow",
"snyk-security.snyk-vulnerability-scanner",
"sonarsource.sonarlint-vscode",
"esbenp.prettier-vscode",
"alexkrechik.cucumberautocomplete",
"JosefBiehler.cypress-fixture-intellisense",
"Shelex.vscode-cy-helper",
"dbaeumer.vscode-eslint",
"siarheikuchuk.gherkin-beautifier-vs-code-plugin",
"techer.open-in-browser",
"VisualStudioExptTeam.vscodeintellicode"
],
"settings": {
"jest.runMode": "on-demand",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"eslint.validate": [
"javascript",
"javascriptreact",
"json",
"jsonc",
"json5"
],
"cSpell.words": [],
"cSpell.minWordLength": 4,
"cSpell.showStatus": true,
"cSpell.allowCompoundWords": true,
"compile-hero.disable-compile-files-on-did-save-code": true,
"breadcrumbs.enabled": false,
"editor.cursorBlinking": "blink",
"editor.lineDecorationsWidth": "30",
"editor.folding": false,
"editor.hideCursorInOverviewRuler": true,
"editor.occurrencesHighlight": "off",
"editor.roundedSelection": false,
"editor.selectionHighlight": true,
"editor.scrollBeyondLastLine": false,
"explorer.openEditors.visible": 1,
"window.zoomLevel": 0,
"workbench.editor.showIcons": true,
"workbench.startupEditor": "none",
"workbench.tree.renderIndentGuides": "none",
"editor.formatOnPaste": false,
"workbench.editor.highlightModifiedTabs": true,
"files.trimFinalNewlines": true,
"editor.acceptSuggestionOnEnter": "off",
"cypressHelper.menuItems.OpenCypress": false,
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": "active",
"editor.guides.indentation": false,
"cucumberautocomplete.smartSnippets": true,
"cucumberautocomplete.steps": "cypress/integration/steps/*.js",
"cucumberautocomplete.syncfeatures": "cypress/integration/features/*.feature",
"cucumberautocomplete.strictGherkinCompletion": false,
"cucumberautocomplete.strictGherkinValidation": false,
"cucumberautocomplete.skipDocStringsFormat": false,
"cucumberautocomplete.onTypeFormat": true,
"editor.quickSuggestions": {
"comments": false,
"strings": true,
"other": true
},
"conf.view.indentSymbol": "space",
"conf.view.identsBefore.Feature": 0,
"conf.view.identsBefore.Scenario": 2,
"conf.view.identsBefore.Background": 2,
"conf.view.identsBefore.ScenarioOutline": 2,
"conf.view.identsBefore.Given": 4,
"conf.view.identsBefore.When": 4,
"conf.view.identsBefore.Then": 4,
"conf.view.identsBefore.And": 4,
"conf.view.identsBefore.Tag": "relative",
"conf.view.identsBefore.Table": 6,
"conf.view.identsBefore.Examples": 4,
"conf.view.table.autoformat": true,
"cSpell.ignoreWords": [],
"git.ignoreLimitWarning": true,
"[json]": {
"editor.formatOnSave": true
}
}
}
}
}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line if you want start specific services in your Docker Compose config.
// "runServices": [],

// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}
26 changes: 26 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
services:
ffc-pay-web:
build:
target: development
image: ffc-pay-web-development
container_name: ffc-pay-web-development
ports:
- "3007:3007"
- "9238:9229"
volumes:
- ../.gitignore:/workspaces:cached/.gitignore
- ..:/workspaces:cached
environment:
AZURE_STORAGE_CONNECTION_STRING: DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://ffc-pay-event-store-azurite:10000/devstoreaccount1;TableEndpoint=http://ffc-pay-event-store-azurite:10002/devstoreaccount1;
JAVA_HOME: /usr/lib/jvm/java-17-openjdk

ffc-pay-event-store-azurite:
volumes:
- azurite_data:/data
ports:
- "10070:10000"
- "10071:10001"
- "10072:10002"

volumes:
azurite_data:
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
75 changes: 61 additions & 14 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.4.0",
"version": "1.5.0",
"plugins_used": [
{
"name": "ArtifactoryDetector"
Expand All @@ -26,6 +26,9 @@
{
"name": "GitHubTokenDetector"
},
{
"name": "GitLabTokenDetector"
},
{
"name": "HexHighEntropyString",
"limit": 3.0
Expand All @@ -36,6 +39,9 @@
{
"name": "IbmCosHmacDetector"
},
{
"name": "IPPublicDetector"
},
{
"name": "JwtTokenDetector"
},
Expand All @@ -49,9 +55,15 @@
{
"name": "NpmDetector"
},
{
"name": "OpenAIDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "PypiTokenDetector"
},
{
"name": "SendGridDetector"
},
Expand All @@ -67,6 +79,9 @@
{
"name": "StripeDetector"
},
{
"name": "TelegramBotTokenDetector"
},
{
"name": "TwilioKeyDetector"
}
Expand Down Expand Up @@ -108,20 +123,36 @@
}
],
"results": {
".devcontainer/docker-compose.yml": [
{
"type": "Secret Keyword",
"filename": ".devcontainer/docker-compose.yml",
"hashed_secret": "564d0eeb4f4d2d1dce2900acdd94500570284e37",
"is_verified": false,
"line_number": 14
},
{
"type": "Azure Storage Account access key",
"filename": ".devcontainer/docker-compose.yml",
"hashed_secret": "5666459779d6a76bea73453137803fd27d8f79cd",
"is_verified": false,
"line_number": 14
}
],
"docker-compose.override.yaml": [
{
"type": "Secret Keyword",
"filename": "docker-compose.override.yaml",
"hashed_secret": "3a9bc5cb5668e15fe0bcc6bfa6b5a0e6dd4d1c67",
"hashed_secret": "564d0eeb4f4d2d1dce2900acdd94500570284e37",
"is_verified": false,
"line_number": 19
"line_number": 17
},
{
"type": "Azure Storage Account access key",
"filename": "docker-compose.override.yaml",
"hashed_secret": "5666459779d6a76bea73453137803fd27d8f79cd",
"is_verified": false,
"line_number": 19
"line_number": 17
}
],
"docker-compose.test.yaml": [
Expand All @@ -130,21 +161,21 @@
"filename": "docker-compose.test.yaml",
"hashed_secret": "10f38898af083f58af3e236b345843571ea5b3d4",
"is_verified": false,
"line_number": 15
"line_number": 13
},
{
"type": "Secret Keyword",
"type": "Azure Storage Account access key",
"filename": "docker-compose.test.yaml",
"hashed_secret": "3a9bc5cb5668e15fe0bcc6bfa6b5a0e6dd4d1c67",
"hashed_secret": "5666459779d6a76bea73453137803fd27d8f79cd",
"is_verified": false,
"line_number": 20
"line_number": 18
},
{
"type": "Azure Storage Account access key",
"type": "Secret Keyword",
"filename": "docker-compose.test.yaml",
"hashed_secret": "5666459779d6a76bea73453137803fd27d8f79cd",
"hashed_secret": "e6e0f255a8a4d88c13b994c38e109457e5c7e15d",
"is_verified": false,
"line_number": 20
"line_number": 18
}
],
"docker-compose.yaml": [
Expand All @@ -153,7 +184,7 @@
"filename": "docker-compose.yaml",
"hashed_secret": "d7f7a811463157aed6db3f8758aa6c93943d2a81",
"is_verified": false,
"line_number": 20
"line_number": 19
}
],
"helm/ffc-pay-web/values.yaml": [
Expand All @@ -162,9 +193,25 @@
"filename": "helm/ffc-pay-web/values.yaml",
"hashed_secret": "d7f7a811463157aed6db3f8758aa6c93943d2a81",
"is_verified": false,
"line_number": 45
"line_number": 46
}
],
".devcontainer/docker-compose.yml": [
{
"type": "Secret Keyword",
"filename": ".devcontainer/docker-compose.yml",
"hashed_secret": "564d0eeb4f4d2d1dce2900acdd94500570284e37",
"is_verified": false,
"line_number": 14
},
{
"type": "Azure Storage Account access key",
"filename": ".devcontainer/docker-compose.yml",
"hashed_secret": "5666459779d6a76bea73453137803fd27d8f79cd",
"is_verified": false,
"line_number": 14
}
]
},
"generated_at": "2023-04-13T11:32:50Z"
"generated_at": "2024-09-10T08:47:53Z"
}
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ ARG PORT
ARG PORT_DEBUG
ENV PORT ${PORT}
EXPOSE ${PORT} ${PORT_DEBUG}
USER root
RUN apk add --update --no-cache openjdk17-jre

USER node
COPY --chown=node:node package*.json ./
RUN npm install
COPY --chown=node:node . .
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffc-pay-web",
"version": "1.20.8",
"version": "1.20.9",
"description": "FFC payment management service",
"homepage": "https://github.com/DEFRA/ffc-pay-web",
"main": "app/index.js",
Expand Down

0 comments on commit 514b0a9

Please sign in to comment.