-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2156 from shreddedbacon/service-types
Add Project/Environment EnvVar overrides for service types
- Loading branch information
Showing
15 changed files
with
555 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
docker-compose-yaml: docker-compose.yml | ||
|
||
environment_variables: | ||
git_sha: 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ARG IMAGE_REPO | ||
FROM ${IMAGE_REPO:-amazeeio}/node:10-builder as builder | ||
COPY package.json yarn.lock /app/ | ||
RUN yarn install | ||
|
||
FROM ${IMAGE_REPO:-amazeeio}/node:10 | ||
COPY --from=builder /app/node_modules /app/node_modules | ||
COPY . /app/ | ||
|
||
ARG LAGOON_GIT_SHA=0000000000000000000000000000000000000000 | ||
ENV LAGOON_GIT_SHA_BUILDTIME ${LAGOON_GIT_SHA} | ||
|
||
ARG LAGOON_GIT_BRANCH=undefined | ||
ENV LAGOON_GIT_BRANCH_BUILDTIME ${LAGOON_GIT_BRANCH} | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["yarn", "run", "start"] |
23 changes: 23 additions & 0 deletions
23
tests/files/features-lagoon-type-override/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: '2' | ||
services: | ||
node: | ||
networks: | ||
- amazeeio-network | ||
- default | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
labels: | ||
lagoon.type: none | ||
lagoon.persistent: /files | ||
volumes: | ||
- ./index.js:/app/index.js:delegated | ||
expose: | ||
- "3000" | ||
environment: | ||
- AMAZEEIO_URL=node.docker.amazee.io | ||
- AMAZEEIO=AMAZEEIO | ||
- AMAZEEIO_HTTP_PORT=3000 | ||
networks: | ||
amazeeio-network: | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const express = require('express') | ||
const fs = require('fs'); | ||
const app = express() | ||
|
||
app.get('/', async function (req, res) { | ||
let result = [] | ||
Object.keys(process.env).map(key => { | ||
result.push(`${key}=${process.env[key]}`) | ||
}) | ||
result.sort() | ||
|
||
try { | ||
result.push(fs.readFileSync('/files/cron.txt').toString()); | ||
} catch (e) { | ||
// intentionally left empty | ||
} | ||
|
||
res.send(result.join("<br />")) | ||
|
||
}) | ||
|
||
app.listen(3000, function () { | ||
console.log('Example app listening on port 3000!') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "node", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"express": "^4.15.3" | ||
}, | ||
"scripts": { | ||
"start": "node index.js" | ||
} | ||
} |
Oops, something went wrong.