강동현
Builds for 1 pipeline passed in 7 minutes 57 seconds

Merge branch 'feature/docker' into develop

1 +.git
2 +*/node_modules
3 +*/dist
4 +*/.nyc_output
5 +*/coverage
...\ No newline at end of file ...\ No newline at end of file
1 +version: "3"
2 +
3 +services:
4 + server:
5 + build:
6 + context: .
7 + dockerfile: ./server/Dockerfile
8 + restart: unless-stopped
9 + ports:
10 + - "3000:3000"
11 +
12 + web:
13 + build:
14 + context: .
15 + dockerfile: ./web/Dockerfile
16 + restart: unless-stopped
17 + ports:
18 + - "80:80"
1 +FROM node:14-alpine
2 +
3 +WORKDIR /usr
4 +
5 +COPY common ./common
6 +COPY server ./server
7 +
8 +WORKDIR /usr/common
9 +
10 +RUN yarn install
11 +
12 +WORKDIR /usr/server
13 +
14 +RUN yarn install
15 +RUN yarn build
16 +
17 +EXPOSE 3000
18 +
19 +CMD [ "node", "dist/server/index.js" ]
1 +FROM node:14-alpine as build
2 +
3 +WORKDIR /usr
4 +
5 +COPY common ./common
6 +COPY web ./web
7 +
8 +WORKDIR /usr/common
9 +
10 +RUN yarn install
11 +
12 +WORKDIR /usr/web
13 +
14 +RUN yarn install
15 +RUN yarn build
16 +
17 +FROM nginx:latest
18 +
19 +COPY web/default.conf /etc/nginx/conf.d/default.conf
20 +COPY --from=build /usr/web/build /usr/web/build
21 +
22 +EXPOSE 80
23 +
24 +CMD ["nginx", "-g", "daemon off;"]
...\ No newline at end of file ...\ No newline at end of file
1 +server {
2 + listen 80;
3 + location / {
4 + root /usr/web/build;
5 + index index.html;
6 + try_files $uri $uri/ /index.html;
7 + }
8 +}
...\ No newline at end of file ...\ No newline at end of file
1 -import React from 'react'; 1 +import React from "react";
2 -import { io } from 'socket.io-client'; 2 +import { io } from "socket.io-client";
3 3
4 -export const socket = io('http://localhost:3000/'); 4 +export const socket = io(`http://${window.location.hostname}:3000/`);
5 const SocketContext = React.createContext(socket); 5 const SocketContext = React.createContext(socket);
6 6
7 export const SocketProvider = SocketContext.Provider; 7 export const SocketProvider = SocketContext.Provider;
......