-
Notifications
You must be signed in to change notification settings - Fork 0
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 #21 from IT4Change/docker-updates
fix(backend): docker fixes
- Loading branch information
Showing
6 changed files
with
80 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "backend:test:build test docker" | ||
|
||
on: push | ||
|
||
jobs: | ||
# only (but most important) job from this workflow required for pull requests | ||
# check results serve as run conditions for all other jobs here | ||
files-changed: | ||
name: Detect File Changes - backend-test-build-docker | ||
runs-on: ubuntu-latest | ||
outputs: | ||
changes: ${{ steps.changes.outputs.backend-test-build-docker }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Check for backend file changes | ||
uses: dorny/[email protected] | ||
id: changes | ||
with: | ||
token: ${{ github.token }} | ||
filters: .github/file-filters.yml | ||
list-files: shell | ||
|
||
build-production: | ||
if: needs.files-changed.outputs.changes == 'true' | ||
name: Build Docker Production - Backend | ||
needs: files-changed | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Backend | Build Docker Production | ||
run: docker compose -f docker-compose.yml build | ||
|
||
build-development: | ||
if: needs.files-changed.outputs.changes == 'true' | ||
name: Build Docker Development - Backend | ||
needs: files-changed | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Backend | Build Docker Development | ||
run: docker compose build |
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 |
---|---|---|
@@ -1,23 +1,42 @@ | ||
version: '3.4' | ||
|
||
services: | ||
# ###################################################### | ||
# BACKEND ############################################## | ||
# ###################################################### | ||
####################################################### | ||
# BACKEND ############################################# | ||
####################################################### | ||
backend: | ||
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there | ||
image: it4c/backend:local-development | ||
build: | ||
target: development | ||
environment: | ||
- NODE_ENV="development" | ||
# - DEBUG=true | ||
- NODE_ENV=development | ||
volumes: | ||
# This makes sure the docker container has its own node modules. | ||
# Therefore it is possible to have a different node version on the host machine | ||
- backend_node_modules:/server/node_modules | ||
# bind the local folder to the docker to allow live reload | ||
- ./:/server | ||
|
||
####################################################### | ||
# DOCUMENTATION ####################################### | ||
####################################################### | ||
documentation: | ||
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there | ||
image: it4c/backend:local-documentation | ||
build: | ||
target: documentation | ||
ports: | ||
- 8080:8080 | ||
environment: | ||
- NODE_ENV=development | ||
volumes: | ||
# This makes sure the docker container has its own node modules. | ||
# Therefore it is possible to have a different node version on the host machine | ||
- documentation_node_modules:/app/node_modules | ||
# bind the local folder to the docker to allow live reload | ||
- ./:/app | ||
|
||
volumes: | ||
backend_node_modules: | ||
documentation_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
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