chore: docker cleanup and changes

This commit is contained in:
AP 2020-04-01 21:38:35 +02:00
parent a9df78ac2d
commit 22bbf2665b
4 changed files with 11 additions and 14 deletions

4
client/.gitignore vendored
View file

@ -11,8 +11,12 @@
# production
/build
#webpack
/dist
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local

View file

@ -1,4 +1,3 @@
# stage: 1
FROM node:11-alpine as build
WORKDIR /usr/src/client
@ -10,9 +9,6 @@ RUN yarn install --production=true
COPY . /usr/src/client
RUN yarn build
# stage: 2 — the production environment
FROM nginx:alpine
COPY /config/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /usr/src/client/build /usr/share/nginx/html/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
RUN yarn global add serve
CMD ["serve", "-s", "build"]

View file

@ -24,10 +24,7 @@ const ContentView = React.lazy(() => import('./sections/content/Content'));
toast.configure({ draggable: false });
const client = new ApolloClient({
uri:
process.env.NODE_ENV === 'development'
? 'http://localhost:3001'
: 'https://api.thunderhub.io/',
uri: process.env.REACT_APP_API_URL ?? 'http://localhost:3001',
});
const ContextApp: React.FC = () => {

View file

@ -4,6 +4,7 @@ services:
### SETUP SERVER CONTAINER
##########################
backend:
image: apotdevin/thunderhub-server
build:
context: ./server
dockerfile: Dockerfile
@ -18,13 +19,12 @@ services:
### SETUP CLIENT CONTAINER
##########################
frontend:
image: apotdevin/thunderhub-client
build:
context: ./client
dockerfile: Dockerfile
environment:
- NODE_ENV=production
ports:
- "80:80"
- "5000:5000"
volumes:
- ./client/
depends_on: