File tree Expand file tree Collapse file tree 5 files changed +6
-17
lines changed Expand file tree Collapse file tree 5 files changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,7 @@ COPY . .
18
18
# Any NEXT_PUBLIC env variables must be added here for them to work.
19
19
ENV NEXT_PUBLIC_URL=NEXT_PUBLIC_URL
20
20
ENV NEXT_PUBLIC_DOWNLOADS_URL=NEXT_PUBLIC_DOWNLOADS_URL
21
- ENV NEXT_PUBLIC_STRAPI_PROTO=NEXT_PUBLIC_STRAPI_PROTO
22
- ENV NEXT_PUBLIC_STRAPI_HOST=NEXT_PUBLIC_STRAPI_HOST
23
- ENV NEXT_PUBLIC_STRAPI_PORT=NEXT_PUBLIC_STRAPI_PORT
21
+ ENV NEXT_PUBLIC_STRAPI_URL=NEXT_PUBLIC_STRAPI_URL
24
22
25
23
RUN npm run build
26
24
Original file line number Diff line number Diff line change @@ -40,9 +40,7 @@ LOCAL_DOWNLOADS_URL=http://localhost:10000
40
40
NEXT_REVALIDATE_TIME=600
41
41
42
42
STRAPI_API_TOKEN=YOUR_TOKEN_HERE
43
- NEXT_PUBLIC_STRAPI_PROTO=http
44
- NEXT_PUBLIC_STRAPI_HOST=localhost
45
- NEXT_PUBLIC_STRAPI_PORT=1337
43
+ NEXT_PUBLIC_STRAPI_URL=http://localhost:1337
46
44
```
47
45
48
46
> Replace ` YOUR_TOKEN_HERE ` with a token generated on your Strapi instance created by following [ web-cms] ( https://github.com/starpep-web/web-cms ) 's README.
@@ -92,7 +90,7 @@ docker build -t local-starpep/web-frontend:latest .
92
90
You can create a new container to try it out with the following command:
93
91
94
92
``` bash
95
- docker run -it --rm -p 3000:3000 -e API_URL=http://localhost:4000 -e BIO_API_URL=http://localhost:8000 -e NEXT_PUBLIC_URL=http://localhost:3000 -e NEXT_PUBLIC_DOWNLOADS_URL=http://localhost:10000 -e LOCAL_DOWNLOADS_URL=http://localhost:10000 -e NEXT_REVALIDATE_TIME=600 -e STRAPI_API_TOKEN=YOUR_TOKEN_HERE -e NEXT_PUBLIC_STRAPI_PROTO =http -e NEXT_PUBLIC_STRAPI_HOST= localhost -e NEXT_PUBLIC_STRAPI_PORT= 1337 local-starpep/web-frontend:latest
93
+ docker run -it --rm -p 3000:3000 -e API_URL=http://localhost:4000 -e BIO_API_URL=http://localhost:8000 -e NEXT_PUBLIC_URL=http://localhost:3000 -e NEXT_PUBLIC_DOWNLOADS_URL=http://localhost:10000 -e LOCAL_DOWNLOADS_URL=http://localhost:10000 -e NEXT_REVALIDATE_TIME=600 -e STRAPI_API_TOKEN=YOUR_TOKEN_HERE -e NEXT_PUBLIC_STRAPI_URL =http:// localhost: 1337 local-starpep/web-frontend:latest
96
94
docker run -it --rm -p 3000:3000 local-starpep/web-frontend:latest
97
95
```
98
96
Original file line number Diff line number Diff line change 1
1
import 'dotenv/config' ;
2
2
import { CodegenConfig } from '@graphql-codegen/cli' ;
3
3
4
- const NEXT_PUBLIC_STRAPI_URL = `${ process . env . NEXT_PUBLIC_STRAPI_PROTO } ://${ process . env . NEXT_PUBLIC_STRAPI_HOST } ${ process . env . NEXT_PUBLIC_STRAPI_PORT ? `:${ process . env . NEXT_PUBLIC_STRAPI_PORT } ` : '' } ` ;
5
- const GRAPHQL_URL = `${ NEXT_PUBLIC_STRAPI_URL } /graphql` ;
4
+ const GRAPHQL_URL = `${ process . env . NEXT_PUBLIC_STRAPI_URL } /graphql` ;
6
5
7
6
const config : CodegenConfig = {
8
7
schema : GRAPHQL_URL ,
Original file line number Diff line number Diff line change @@ -11,9 +11,7 @@ declare global {
11
11
NEXT_REVALIDATE_TIME ?: string
12
12
13
13
STRAPI_API_TOKEN ?: string
14
- NEXT_PUBLIC_STRAPI_PROTO ?: string
15
- NEXT_PUBLIC_STRAPI_HOST ?: string
16
- NEXT_PUBLIC_STRAPI_PORT ?: string
14
+ NEXT_PUBLIC_STRAPI_URL ?: string
17
15
}
18
16
}
19
17
}
Original file line number Diff line number Diff line change @@ -8,8 +8,4 @@ export const LOCAL_DOWNLOADS_URL = process.env.LOCAL_DOWNLOADS_URL!;
8
8
export const NEXT_REVALIDATE_TIME = process . env . NEXT_REVALIDATE_TIME ? parseInt ( process . env . NEXT_REVALIDATE_TIME , 10 ) : 3600 ;
9
9
10
10
export const STRAPI_API_TOKEN = process . env . STRAPI_API_TOKEN ! ;
11
- export const NEXT_PUBLIC_STRAPI_PROTO = process . env . NEXT_PUBLIC_STRAPI_PROTO ! ;
12
- export const NEXT_PUBLIC_STRAPI_HOST = process . env . NEXT_PUBLIC_STRAPI_HOST ! ;
13
- export const NEXT_PUBLIC_STRAPI_PORT = process . env . NEXT_PUBLIC_STRAPI_PORT ?? '' ;
14
-
15
- export const NEXT_PUBLIC_STRAPI_URL = `${ NEXT_PUBLIC_STRAPI_PROTO } ://${ NEXT_PUBLIC_STRAPI_HOST } ${ NEXT_PUBLIC_STRAPI_PORT ? `:${ NEXT_PUBLIC_STRAPI_PORT } ` : '' } ` ;
11
+ export const NEXT_PUBLIC_STRAPI_URL = process . env . NEXT_PUBLIC_STRAPI_URL ! ;
You can’t perform that action at this time.
0 commit comments