Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerfiles and docker-compose added #158

Merged
merged 4 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions practice-app/backend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
target/
.metadata
/.metadata/
6 changes: 6 additions & 0 deletions practice-app/backend/disasterresponse/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM openjdk:17-jdk
VOLUME /tmp
EXPOSE 4000
ARG JAR_FILE=target/disasterresponse-0.0.1-SNAPSHOT.jar
ADD ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
# Details for our datasource
spring.datasource.url = jdbc:postgresql://localhost:5432/disasterresponse
spring.datasource.driverClassName = org.postgresql.Driver
spring.datasource.username =postgres
spring.datasource.password =112212
spring.jpa.hibernate.ddl-auto= create
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect

# To change server port only

server.port=4000

# Google Geocoding API Key
google.api.key=AIzaSyBPeYGBe5LSvsTllC2YhCIH5RcvnohY0zE

server.port=4000

28 changes: 28 additions & 0 deletions practice-app/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3.1'
services:
app:
container_name: backend
image: backend:latest
build: ./backend/disasterresponse
ports:
- "4000:4000"
depends_on:
- postgresqldb
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/compose-postgres
- SPRING_DATASOURCE_USERNAME=compose-postgres
- SPRING_DATASOURCE_PASSWORD=compose-postgres
- SPRING_JPA_HIBERNATE_DDL_AUTO=update

postgresqldb:
image: 'postgres:13.1-alpine'
container_name: db
environment:
- POSTGRES_USER=compose-postgres
- POSTGRES_PASSWORD=compose-postgres
frontend:
container_name: frontend
build: ./frontend/disasterresponse
image: frontend:latest
ports:
- "3000:3000"
6 changes: 6 additions & 0 deletions practice-app/frontend/disasterresponse/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:14-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
CMD ["npm", "start"]
16 changes: 8 additions & 8 deletions practice-app/frontend/disasterresponse/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion practice-app/frontend/disasterresponse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"react-scripts": "^5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down