mirror of
https://github.com/sergeyyarkov/next-apollo-graphql-setup.git
synced 2026-10-11 18:29:36 +03:00
➕ added docker
This commit is contained in:
parent
6f1205ed75
commit
982e332214
9
.dockerignore
Normal file
9
.dockerignore
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
/node_modules
|
||||||
|
|
||||||
|
/.next/
|
||||||
|
|
||||||
|
/build
|
||||||
|
|
||||||
|
npm-debug.log
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
13
Dockerfile
Normal file
13
Dockerfile
Normal 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
8
docker-compose.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
container_name: apollo-next-graphql
|
||||||
|
restart: always
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- '3000:3000'
|
||||||
@ -3,7 +3,7 @@ import { HttpLink } from 'apollo-boost'
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
link: new HttpLink({
|
link: new HttpLink({
|
||||||
uri: 'http://localhost:3000/api/graphql',
|
uri: process.env.GRAPHQL_API_URI,
|
||||||
opts: {
|
opts: {
|
||||||
credentials: 'same-origin'
|
credentials: 'same-origin'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,5 +9,8 @@ module.exports = withSass({
|
|||||||
config.optimization.minimizer.push(new OptimizeCSSAssetsPlugin({}))
|
config.optimization.minimizer.push(new OptimizeCSSAssetsPlugin({}))
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
},
|
||||||
|
env: {
|
||||||
|
GRAPHQL_API_URI: 'http://localhost:3000/api/graphql'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user