-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from Nummenpojat/configuration-for-deployment
Configuration for deployment
- Loading branch information
Showing
9 changed files
with
91 additions
and
38 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,3 @@ | ||
node_modules | ||
.idea | ||
build |
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,32 @@ | ||
# Use Node.js 18 as the base image | ||
FROM node:18 as build | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json files to the container | ||
COPY package*.json ./ | ||
|
||
# Install dependencies | ||
RUN npm install | ||
|
||
# Copy the rest of the application code to the container | ||
COPY . . | ||
|
||
# Build the React app | ||
RUN npm run build | ||
|
||
# Use a lightweight Nginx image as the base image | ||
FROM nginx:1.21 | ||
|
||
# Copy the React build files to the Nginx default public folder | ||
COPY --from=build /app/build /usr/share/nginx/html | ||
|
||
# Copy the Nginx configuration file to the container | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
# Expose the port used by Nginx | ||
EXPOSE 80 | ||
|
||
# Start Nginx | ||
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,17 @@ | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
location /api { | ||
proxy_pass http://core:3001/; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 @@ | ||
{ | ||
"apiKey": "AIzaSyBWcwH_q5vnqSRhtiIZShtNray1aYzRRtI", | ||
"authDomain": "suppis-382f9.firebaseapp.com", | ||
"projectId": "suppis-382f9", | ||
"storageBucket": "suppis-382f9.appspot.com", | ||
"messagingSenderId": "847554464937", | ||
"appId": "1:847554464937:web:2afeb9e429ff128bd12db8" | ||
} |
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
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