Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
clean up and added dev compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
spara committed May 16, 2017
1 parent 9cf27e4 commit 9cd54df
Show file tree
Hide file tree
Showing 16 changed files with 87 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="com/docker/atsea/controller/RestApiController.java" kind="src" output="target/classes" path="src/main/java">
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
Expand Down
3 changes: 2 additions & 1 deletion .settings/org.eclipse.jdt.core.prefs
@@ -1,5 +1,6 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
Expand All @@ -9,4 +10,4 @@ org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.source=1.8
1 change: 1 addition & 0 deletions README.md
@@ -1,3 +1,4 @@
![](atsea_store.png)
# AtSea Shop Demonstration Application

The AtSea Shop is a demonstration application comprised of:
Expand Down
2 changes: 1 addition & 1 deletion app/Dockerfile
Expand Up @@ -18,4 +18,4 @@ COPY --from=0 /usr/src/atsea/app/react-app/build/ .
WORKDIR /app
COPY --from=1 /usr/src/atsea/target/AtSea-0.0.1-SNAPSHOT.jar .
ENTRYPOINT ["java", "-jar", "/app/AtSea-0.0.1-SNAPSHOT.jar"]
CMD ["--spring.profiles.active=postgres", "--debug"]
CMD ["--spring.profiles.active=postgres"]
22 changes: 22 additions & 0 deletions app/Dockerfile-dev
@@ -0,0 +1,22 @@
FROM node:latest
WORKDIR /usr/src/atsea/app/react-app
COPY app/react-app/package.json .
RUN npm install
COPY . /usr/src/atsea
RUN npm run build

FROM maven:latest
WORKDIR /usr/src/atsea
COPY pom.xml .
RUN mvn -B -f pom.xml -s /usr/share/maven/ref/settings-docker.xml dependency:resolve
COPY . .
RUN mvn -B -s /usr/share/maven/ref/settings-docker.xml package -DskipTests

FROM java:8-jdk-alpine
WORKDIR /static
COPY --from=0 /usr/src/atsea/app/react-app/build/ .
WORKDIR /app
COPY --from=1 /usr/src/atsea/target/AtSea-0.0.1-SNAPSHOT.jar .
EXPOSE 5005
ENTRYPOINT ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005","-jar", "/app/AtSea-0.0.1-SNAPSHOT.jar"]
CMD ["--spring.profiles.active=postgres"]
8 changes: 0 additions & 8 deletions app/Dockerfile.openjdk1.8-nanoserver

This file was deleted.

8 changes: 0 additions & 8 deletions app/Dockerfile.oraclejdk1.8-nanoserver

This file was deleted.

Binary file added atsea_store.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion devsecrets/postgres_password
@@ -1 +1 @@
gordonpassword
gordonpass
40 changes: 40 additions & 0 deletions docker-compose-dev.yml
@@ -0,0 +1,40 @@
version: "3.1"

services:
database:
build:
context: ./database
image: atsea_db
environment:
POSTGRES_USER: gordonuser
POSTGRES_DB: atsea
ports:
- "5432:5432"
networks:
- back-tier
secrets:
- postgres_password

appserver:
build:
context: .
dockerfile: app/Dockerfile-dev
image: atsea_app
ports:
- "8080:8080"
- "5005:5005"
networks:
- front-tier
- back-tier
secrets:
- postgres_password

secrets:
postgres_password:
file: ./devsecrets/postgres_password

networks:
front-tier:
back-tier:
payment:
driver: overlay
1 change: 1 addition & 0 deletions docker-compose.yml
Expand Up @@ -26,6 +26,7 @@ services:
image: atsea_app
ports:
- "8080:8080"
- "5005:5005"
networks:
- front-tier
- back-tier
Expand Down
Binary file removed frontend-2017-04-05.png
Binary file not shown.
Binary file removed landing.png
Binary file not shown.
10 changes: 9 additions & 1 deletion pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.3.RELEASE</version>
<version>1.5.3.RELEASE</version>
</parent>

<groupId>com.docker.atsea</groupId>
Expand Down Expand Up @@ -89,6 +89,11 @@
<artifactId>jjwt</artifactId>
<version>0.7.0</version>
</dependency>
<!-- devtools support -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<!-- Add for tests -->
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -118,6 +123,9 @@
<plugin><!-- Create a jar with all dependencies, run commandline using java -jar NAME -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludeDevtools>true</excludeDevtools>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Expand Up @@ -63,7 +63,7 @@ public DataSourceProperties dataSourceProperties() {
} catch (IOException e) {
System.err.println("Could not successfully load DB password file");
}

return dataSourceProperties;
}

Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/application.yml
Expand Up @@ -21,10 +21,18 @@ datasource:
---
spring:
profiles: postgres
devtools:
remote:
secret: secretkey
restart:
enabled: true
livereload:
enabled: true
datasource:
atsea:
url: jdbc:postgresql://database:5432/atsea
username: gordonuser
password: gordonpass
driverClassName: org.postgresql.Driver
defaultSchema:
maxConnections: 300
Expand Down

0 comments on commit 9cd54df

Please sign in to comment.