-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added Dockerfile to the frontend and backend and then configure…
…d it
- Loading branch information
1 parent
c3f4636
commit 9a1269d
Showing
7 changed files
with
59 additions
and
5 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
Empty file.
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
FROM eclipse-temurin:17 | ||
|
||
ENV APP_VERSION=0.0.1-SNAPSHOT | ||
|
||
COPY target/power-pay-backend-$APP_VERSION.jar app.jar | ||
|
||
ENTRYPOINT ["java", "-jar", "app.jar"] |
6 changes: 6 additions & 0 deletions
6
power-pay-backend/src/main/resources/application-postgres.yaml
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,6 @@ | ||
spring: | ||
datasource: | ||
driver-class-name: org.postgresql.Driver | ||
url: jdbc:postgresql://localhost:5432/postgres | ||
username: postgres | ||
password: password |
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,3 @@ | ||
node_modules | ||
build | ||
npm-debug.log |
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 |
---|---|---|
@@ -1 +1,30 @@ | ||
FROM nginx | ||
# Use the official Node.js runtime as the base image | ||
FROM node:18 as build | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json to the working directory | ||
COPY package*.json ./ | ||
|
||
# Install dependencies | ||
RUN npm install | ||
|
||
# Copy the entire application code to the container | ||
COPY . . | ||
|
||
# Build the React app for production | ||
RUN npm run build | ||
|
||
# Use Nginx as the production server | ||
FROM nginx:stable-alpine | ||
|
||
# Copy the built React app to Nginx's web server directory | ||
COPY --from=build /app/dist /usr/share/nginx/html | ||
COPY --from=build /app/nginx/nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
# Expose port 80 for the Nginx server | ||
EXPOSE 80 | ||
|
||
# Start Nginx when the container runs | ||
CMD ["nginx", "-g", "daemon off;"] |
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,8 @@ | ||
server { | ||
listen 80; | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html =404; | ||
} | ||
} |