-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
142 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,49 @@ | ||
Procfile | ||
makefile | ||
|
||
# git | ||
.git | ||
.gitattributes | ||
.gitignore | ||
.github | ||
|
||
# docker | ||
docker-compose.yml | ||
docker-compose.* | ||
Dockerfile | ||
.dockerignore | ||
environment/ | ||
|
||
# environment and secretsss | ||
.env | ||
.vscode | ||
|
||
# Common | ||
README.md | ||
CHANGELOG.md | ||
|
||
# logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
/log/* | ||
!/log/.keep | ||
|
||
# tmp | ||
/tmp/* | ||
!/tmp/.keep | ||
*.swp | ||
*~ | ||
.DS_Store | ||
|
||
# Dependencies and dependency managers | ||
node_modules/ | ||
bundle/ | ||
tmp/ | ||
environment/ | ||
docker-compose* | ||
Dockerfile | ||
Procfile | ||
makefile | ||
.DS_Store | ||
# Ignore yarn files | ||
/yarn-error.log | ||
yarn-debug.log* | ||
.yarn-integrity | ||
|
||
# ides | ||
.idea | ||
.vscode |
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,28 @@ | ||
name: Deploy Images to GHCR | ||
|
||
# temporarily run on push for this branch | ||
on: [push] | ||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
# workflow_dispatch: | ||
|
||
jobs: | ||
push-store-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout GitHub Action" | ||
uses: actions/checkout@main | ||
|
||
- name: "Login to GitHub Container Registry" | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{github.actor}} | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: "Build Inventory Image" | ||
run: | | ||
docker build . --tag ghcr.io/wearefuturegov/outpost-api-service:latest | ||
docker push ghcr.io/wearefuturegov/outpost-api-service:latest |
This file was deleted.
Oops, something went wrong.
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,46 @@ | ||
version: "3.7" | ||
services: | ||
outpost-api: | ||
image: "outpost-api:production" | ||
container_name: outpost-api | ||
restart: unless-stopped | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:3001/health"] | ||
interval: 1m30s | ||
timeout: 10s | ||
retries: 3 | ||
start_period: 40s | ||
depends_on: | ||
- mongo | ||
build: | ||
target: production | ||
ports: | ||
- 3001:3001 | ||
volumes: | ||
- ./:/usr/src/app | ||
environment: | ||
NODE_ENV: production | ||
DB_URI: mongodb://mongo:27017/outpost_api | ||
networks: | ||
- outpost_api_internal_network | ||
- outpost_api_external_network | ||
|
||
mongo: | ||
image: mongo:6 | ||
container_name: outpost-api-mongo | ||
restart: unless-stopped | ||
ports: | ||
- 27017:27017 | ||
volumes: | ||
- outpost-api-mongo-volume:/data/db | ||
- ./environment/containers/mongo/setup-mongodb-production.js:/docker-entrypoint-initdb.d/mongo-init.js:ro | ||
networks: | ||
- outpost_api_external_network | ||
|
||
volumes: | ||
outpost-api-mongo-volume: | ||
|
||
networks: | ||
outpost_api_external_network: | ||
outpost_api_internal_network: | ||
internal: 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
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 |
---|---|---|
|
@@ -59,19 +59,19 @@ To get up and running quickly with some data use docker compose. | |
git clone [email protected]:wearefuturegov/outpost-api-service.git && cd outpost-api-service | ||
|
||
# build the image | ||
docker compose -f docker-compose.development.yml build | ||
docker compose build | ||
|
||
# run the container | ||
docker compose -f docker-compose.development.yml up -d | ||
docker compose up -d | ||
|
||
# open shell in container | ||
docker compose -f docker-compose.development.yml exec outpost-api-dev /bin/ash; | ||
docker compose exec outpost-api-dev /bin/ash; | ||
|
||
# run the tests | ||
docker compose -f docker-compose.development.yml exec outpost-api-dev npm run test | ||
docker compose exec outpost-api-dev npm run test | ||
|
||
# stop the container | ||
docker compose -f docker-compose.development.yml stop | ||
docker compose stop | ||
``` | ||
|
||
If you want to use it in conjunction with a local mongodb database, for example you are using [Outpost](https://github.com/wearefuturegov/outpost/) you could also run it using just docker. | ||
|