Skip to content

Commit

Permalink
Improve the Dockerization.
Browse files Browse the repository at this point in the history
Put files in a specific folder and fix the Maven configuration to include credentials.
  • Loading branch information
The4thLaw committed Feb 14, 2024
1 parent 906299b commit 5e6ed7b
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions integration/docker/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Fill with a token coming from GitHub
GITHUB_PKG_TOKEN=abcdef
1 change: 1 addition & 0 deletions integration/docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
4 changes: 4 additions & 0 deletions source/Dockerfile → integration/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ RUN npm run build
FROM maven:3.9-eclipse-temurin-11 AS mvn-build
WORKDIR /mvn-app
COPY . .
# Generate m2 settings with a secret and access to the GitHub packages
RUN mkdir ~/.m2
ARG GITHUB_PKG_TOKEN
RUN echo "<settings><servers><server><id>github-the4thlaw</id><username>The4thLaw</username><password>$GITHUB_PKG_TOKEN</password></server></servers></settings>" > ~/.m2/settings.xml
# Clean to be sure
RUN mvn clean -Pprod,prod-win,vue
# Re-integrate the node build
Expand Down
23 changes: 23 additions & 0 deletions integration/docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Docker integration

## Prepare

Create a `.env` file based on the `.env.example` file.

## Build

```
docker-compose build
```

## Run

```
docker run --name demyo -p 8080:8080 -v demyo-data:/demyo-data -d --rm demyo:3.1.0
```

or

```
docker-compose up -d
```
17 changes: 17 additions & 0 deletions integration/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'

services:
demyo:
image: demyo:3.1.0
build:
context: ../../source
dockerfile: ../integration/docker/Dockerfile
args:
GITHUB_PKG_TOKEN: ${GITHUB_PKG_TOKEN}
ports:
- 8080:8080
volumes:
- demyo-data:/demyo-data

volumes:
demyo-data:

0 comments on commit 5e6ed7b

Please sign in to comment.