File tree 6 files changed +124
-5
lines changed
6 files changed +124
-5
lines changed Original file line number Diff line number Diff line change @@ -208,4 +208,7 @@ docker-persistence/*
208
208
! docker-persistence /.gitkeep
209
209
210
210
# ignore secret configuration files
211
- secret.properties
211
+ secret.properties
212
+
213
+ # Gzipped log file
214
+ * .log. * .gz
Original file line number Diff line number Diff line change 1
1
FROM openjdk:11-jdk-slim
2
+
3
+ # Create user and group to run as
2
4
RUN addgroup --system spring && adduser --system --group spring
5
+
6
+ ARG SPRING_FOLDER=/srv/spring
7
+
8
+ # Create settings and logs folder
9
+ RUN mkdir -pv ${SPRING_FOLDER}/logs && \
10
+ mkdir -pv ${SPRING_FOLDER}/config
11
+
12
+ # Set path for log file
13
+ ENV LOGGING_FILE_NAME=${SPRING_FOLDER}/logs/error.log
14
+
15
+ # Copy over override.properties file to container (ENV variables take precedence)
16
+ ENV SPRING_CONFIG_IMPORT=optional:file:${SPRING_FOLDER}/config/override.properties
17
+ COPY src/main/resources/application.properties.sample ${SPRING_FOLDER}/config/override.properties
18
+
19
+ # Set proper perms
20
+ RUN chown -R spring:spring ${SPRING_FOLDER}
21
+
22
+ # Set run user and group
3
23
USER spring:spring
24
+
25
+ # Copy over compiled jar
4
26
ARG JAR_FILE=build/libs/gremiomat-0.0.1-SNAPSHOT.jar
5
27
COPY ${JAR_FILE} app.jar
28
+
29
+ WORKDIR ${SPRING_FOLDER}
30
+
6
31
ENTRYPOINT ["java" ,"-jar" ,"/app.jar" ]
Original file line number Diff line number Diff line change @@ -10,6 +10,14 @@ group = 'de.astahsrm'
10
10
version = ' 0.0.1-SNAPSHOT'
11
11
sourceCompatibility = ' 11'
12
12
13
+ jar {
14
+ manifest {
15
+ attributes(
16
+ ' Main-Class' : ' de.astahsrm.gremiomat.GremiomatApplication'
17
+ )
18
+ }
19
+ }
20
+
13
21
repositories {
14
22
mavenCentral()
15
23
}
Original file line number Diff line number Diff line change 1
1
version : " 2"
2
2
3
- services :
4
- tomcat-test :
3
+ services :
4
+ spring :
5
5
build : .
6
6
restart : always
7
- container_name : tomcat-test
7
+ environment :
8
+ # required arguments
9
+ - SPRING_DATASOURCE_URL=jdbc:mariadb://db:3306/temp_db
10
+ - SPRING_DATASOURCE_USERNAME=dev
11
+ - SPRING_DATASOURCE_PASSWORD=dev123
12
+ - SPRING_DATASOURCE_DRIVER-CLASS-NAME=org.mariadb.jdbc.Driver
13
+ - SPRING_MAIL_USERNAME=mail@example.com
14
+ - SPRING_MAIL_PASSWORD=N0tTh3Actu4lP4SSw0rd
15
+ # optional arguments
16
+ # - SERVER_PORT=8090
17
+ # - DEBUG=true
18
+ # - SPRING_THYMELEAF_CACHE=false
19
+ # - LOGGING_LEVEL_WEB=DEBUG
20
+ # network_mode: host
8
21
ports :
9
- - 8080:8080
22
+ - 8090:8090
Original file line number Diff line number Diff line change
1
+ # Server config
2
+ # server.port=8090
3
+ # debug=false
4
+ # spring.thymeleaf.cache=false
5
+
6
+ # logging config for Errors
7
+ # logging.file.name=error.log
8
+ # logging.level.web=DEBUG
9
+ # logging.level.org.springframework.web=debug
10
+
11
+ # Database config
12
+ # spring.datasource.url=jdbc:mariadb://localhost:3306/temp_db
13
+ # spring.datasource.username=dev
14
+ # spring.datasource.password=dev123
15
+ # spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
16
+ # spring.jpa.hibernate.ddl-auto=create-drop
17
+ # spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MariaDB103Dialect
18
+
19
+ # For initialising DB with data.sql
20
+ # spring.sql.init.mode=always
21
+ # spring.jpa.defer-datasource-initialization=true
22
+
23
+ # logging.level.org.springframework.boot.autoconfigure=ERROR
24
+
25
+ # Mail config
26
+ spring.mail.default-encoding=UTF-8
27
+ spring.mail.host=host.boi
28
+ spring.mail.port=69
29
+ spring.mail.username=boi
30
+ spring.mail.password=b01
31
+ spring.mail.test-connection=false
32
+ spring.mail.properties.mail.smtp.auth=true
33
+ spring.mail.properties.mail.smtp.starttls.enable=true
34
+
35
+ spring.config.import=optional:file:/srv/spring/config/override.properties
Original file line number Diff line number Diff line change
1
+ # Server config
2
+ # server.port=8090
3
+ # debug=false
4
+ # spring.thymeleaf.cache=false
5
+
6
+ # logging config for Errors
7
+ # logging.file.name=error.log
8
+ # logging.level.web=DEBUG
9
+ # logging.level.org.springframework.web=debug
10
+
11
+ # Database config
12
+ # spring.datasource.url=jdbc:mariadb://localhost:3306/temp_db
13
+ # spring.datasource.username=dev
14
+ # spring.datasource.password=dev123
15
+ # spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
16
+ # spring.jpa.hibernate.ddl-auto=create-drop
17
+ # spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MariaDB103Dialect
18
+
19
+ # For initialising DB with data.sql
20
+ # spring.sql.init.mode=always
21
+ # spring.jpa.defer-datasource-initialization=true
22
+
23
+ # logging.level.org.springframework.boot.autoconfigure=ERROR
24
+
25
+ # Mail config
26
+ # spring.mail.default-encoding=UTF-8
27
+ # spring.mail.host=host.boi
28
+ # spring.mail.port=69
29
+ # spring.mail.username=boi
30
+ # spring.mail.password=b01
31
+ # spring.mail.test-connection=false
32
+ # spring.mail.properties.mail.smtp.auth=true
33
+ # spring.mail.properties.mail.smtp.starttls.enable=true
34
+
35
+ # spring.config.import=optional:file:/srv/spring/config/override.properties
You can’t perform that action at this time.
0 commit comments