➕ added docker

This commit is contained in:
Sergey Yarkov 2020-03-05 21:47:47 +03:00
parent 6f1205ed75
commit 982e332214
5 changed files with 34 additions and 1 deletions

9
.dockerignore Normal file
View File

@ -0,0 +1,9 @@
/node_modules
/.next/
/build
npm-debug.log
yarn-debug.log*
yarn-error.log*

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM node:10
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
CMD ["npm", "start"]

8
docker-compose.yml Normal file
View File

@ -0,0 +1,8 @@
version: '3'
services:
app:
container_name: apollo-next-graphql
restart: always
build: .
ports:
- '3000:3000'

View File

@ -3,7 +3,7 @@ import { HttpLink } from 'apollo-boost'
const config = {
link: new HttpLink({
uri: 'http://localhost:3000/api/graphql',
uri: process.env.GRAPHQL_API_URI,
opts: {
credentials: 'same-origin'
}

View File

@ -9,5 +9,8 @@ module.exports = withSass({
config.optimization.minimizer.push(new OptimizeCSSAssetsPlugin({}))
return config
},
env: {
GRAPHQL_API_URI: 'http://localhost:3000/api/graphql'
}
})