1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

(nextjs) separate Dockerfile for nextjs

This commit is contained in:
Fedor Katurov 2022-01-17 16:38:44 +07:00
parent d4d200f6ef
commit 01c2b163b2
3 changed files with 19 additions and 6 deletions

View file

@ -38,13 +38,13 @@ steps:
branch: branch:
- develop - develop
environment: environment:
REACT_APP_API_HOST: https://pig.staging.vault48.org/ NEXT_PUBLIC_API_HOST: https://pig.staging.vault48.org/
REACT_APP_REMOTE_CURRENT: https://pig.staging.vault48.org/static/ NEXT_PUBLIC_REMOTE_CURRENT: https://pig.staging.vault48.org/static/
settings: settings:
dockerfile: docker/www/Dockerfile dockerfile: docker/nextjs/Dockerfile
build_args_from_env: build_args_from_env:
- REACT_APP_API_HOST - NEXT_PUBLIC_API_HOST
- REACT_APP_REMOTE_CURRENT - NEXT_PUBLIC_REMOTE_CURRENT
tag: tag:
- ${DRONE_BRANCH} - ${DRONE_BRANCH}
custom_labels: custom_labels:

11
docker/nextjs/Dockerfile Normal file
View file

@ -0,0 +1,11 @@
FROM node:14-alpine as builder
COPY package.json yarn.lock ./
RUN yarn
COPY . .
ARG NEXT_PUBLIC_API_HOST
ARG NEXT_PUBLIC_REMOTE_CURRENT
ENV NEXT_PUBLIC_API_HOST $NEXT_PUBLIC_API_HOST
ENV NEXT_PUBLIC_REMOTE_CURRENT $NEXT_PUBLIC_REMOTE_CURRENT
RUN yarn next:build
ENTRYPOINT ["yarn", "nginx:start"]

View file

@ -54,7 +54,9 @@
"build": "craco build", "build": "craco build",
"ts-check": "tsc -p tsconfig.json --noEmit", "ts-check": "tsc -p tsconfig.json --noEmit",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx", "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"prepare": "husky install" "prepare": "husky install",
"next:build": "next build",
"next:start": "next start -p 80"
}, },
"eslintConfig": { "eslintConfig": {
"extends": [ "extends": [