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

Merge branch 'feature/docker' into develop

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