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

Dockerization is complete, but do not merge until database connection is implemented #6

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ dist

# TernJS port file
.tern-port

.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LiRA-Map-Frontend
# LiRA-Map


#### Server
Expand Down
36 changes: 36 additions & 0 deletions client-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.25.0 (HEAD)
creationTimestamp: null
labels:
io.kompose.service: client
name: client
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: client
strategy: {}
template:
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.25.0 (HEAD)
creationTimestamp: null
labels:
io.kompose.network/fullstack: "true"
io.kompose.service: client
spec:
containers:
- image: client
name: client
imagePullPolicy: Never
ports:
- containerPort: 3000
resources: {}
tty: true
restartPolicy: Always
status: {}
19 changes: 19 additions & 0 deletions client-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.25.0 (HEAD)
creationTimestamp: null
labels:
io.kompose.service: client
name: client
spec:
ports:
- name: "3000"
port: 3000
targetPort: 3000
selector:
io.kompose.service: client
status:
loadBalancer: {}
13 changes: 13 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:16

WORKDIR /app-client

COPY package.json /app-client/package.json

ADD . /app-client

EXPOSE 3000

RUN npm i

CMD ["npm", "start"]
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:3001",
"proxy": "http://172.17.0.4:3001",
"eslintConfig": {
"extends": [
"react-app",
Expand Down
31 changes: 31 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: '3.7'

services:

client:
image: client
build:
context: client
dockerfile: Dockerfile
tty: true
container_name: client
ports:
- "3000:3000"
depends_on:
- server
networks:
- fullstack

server:
image: server
build:
context: server
dockerfile: Dockerfile
tty: true
container_name: server
networks:
- fullstack

networks:
fullstack:
driver: bridge
14 changes: 14 additions & 0 deletions fullstack-networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
creationTimestamp: null
name: fullstack
spec:
ingress:
- from:
- podSelector:
matchLabels:
io.kompose.network/fullstack: "true"
podSelector:
matchLabels:
io.kompose.network/fullstack: "true"
34 changes: 34 additions & 0 deletions server-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.25.0 (HEAD)
creationTimestamp: null
labels:
io.kompose.service: server
name: server
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: server
strategy: {}
template:
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.25.0 (HEAD)
creationTimestamp: null
labels:
io.kompose.network/fullstack: "true"
io.kompose.service: server
spec:
containers:
- image: server
name: server
imagePullPolicy: Never
resources: {}
tty: true
restartPolicy: Always
status: {}
13 changes: 13 additions & 0 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:16

WORKDIR /app

COPY package.json /app/package.json

ADD . /app

EXPOSE 3001

RUN npm i

CMD ["npm", "start"]