-
Notifications
You must be signed in to change notification settings - Fork 1
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
DsTyM
committed
Jan 13, 2020
1 parent
73e9a92
commit 0c569b1
Showing
5 changed files
with
80 additions
and
68 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#### Stage 1: Build the application | ||
FROM openjdk:13.0.1 as build | ||
|
||
# Set the current working directory inside the image | ||
WORKDIR /app | ||
|
||
# Copy maven executable to the image | ||
COPY mvnw . | ||
COPY .mvn .mvn | ||
|
||
# Copy the pom.xml file | ||
COPY pom.xml . | ||
|
||
# Build all the dependencies in preparation to go offline. | ||
# This is a separate step so the dependencies will be cached unless | ||
# the pom.xml file has changed. | ||
RUN chmod +x ./mvnw | ||
RUN ./mvnw dependency:go-offline -B | ||
|
||
# Copy the project source | ||
COPY src src | ||
|
||
# Package the application | ||
RUN ./mvnw package -DskipTests | ||
ENTRYPOINT ["java", "-jar", "target/pharmacies-on-duty-attica.jar"] |
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,48 @@ | ||
# Docker Compose file Reference (https://docs.docker.com/compose/compose-file/) | ||
|
||
version: '3.7' | ||
|
||
# Define services | ||
services: | ||
# App backend service | ||
app-server: | ||
# Configuration for building the docker image for the backend service | ||
build: | ||
context: . # Use an image built from the specified dockerfile in the `polling-app-server` directory. | ||
dockerfile: Dockerfile | ||
ports: | ||
- "8080:8080" # Forward the exposed port 8080 on the container to port 8080 on the host machine | ||
restart: always | ||
depends_on: | ||
- db # This service depends on mysql. Start that first. | ||
environment: # Pass environment variables to the service | ||
SPRING_DATASOURCE_URL: jdbc:mysql://db:3306/pharmacies?useSSL=false&serverTimezone=UTC&useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&allowPublicKeyRetrieval=true | ||
SPRING_DATASOURCE_USERNAME: developer | ||
SPRING_DATASOURCE_PASSWORD: developer | ||
networks: # Networks to join (Services on the same network can communicate with each other using their name) | ||
- backend | ||
|
||
# Database Service (Mysql) | ||
db: | ||
image: mysql:8.0.18 | ||
ports: | ||
- "3306:3306" | ||
restart: always | ||
environment: | ||
MYSQL_DATABASE: pharmacies | ||
MYSQL_USER: developer | ||
MYSQL_PASSWORD: developer | ||
MYSQL_ROOT_PASSWORD: root | ||
volumes: | ||
- ./mysql-dump:/docker-entrypoint-initdb.d | ||
- db-data:/var/lib/mysql | ||
networks: | ||
- backend | ||
|
||
# Volumes | ||
volumes: | ||
db-data: | ||
|
||
# Networks to be created to facilitate communication between containers | ||
networks: | ||
backend: |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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