Fix dockerfile

This commit is contained in:
Zoe Roux 2022-11-02 17:56:11 +09:00
parent a221e6358e
commit c64c34a9fb
No known key found for this signature in database
GPG Key ID: B2AB52A2636E5C46
13 changed files with 65 additions and 56 deletions

View File

@ -26,27 +26,15 @@ services:
front: front:
build: build:
context: ./front context: ./front
dockerfile: Dockerfile.web.dev dockerfile: Dockerfile.dev
volumes: volumes:
- ./front:/app - ./front:/app
- /app/.yarn - /app/.yarn
- /app/node_modules - /app/node_modules
- /app/packages/web/.next/ - /app/apps/web/.next/
- /app/apps/mobile/.expo/
ports: ports:
- "3000:3000" - "3000:3000"
restart: on-failure
environment:
- KYOO_URL=http://back:5000
native:
build:
context: ./front
dockerfile: Dockerfile.native.dev
volumes:
- ./front:/app
- /app/.yarn
- /app/node_modules
- /app/packages/native/.expo/
ports:
- "19000:19000" - "19000:19000"
restart: on-failure restart: on-failure
environment: environment:

View File

@ -11,3 +11,4 @@ README.md
.git .git
.yarn .yarn
!.yarn/releases !.yarn/releases
!.yarn/plugins

2
front/.gitignore vendored
View File

@ -35,7 +35,7 @@ yarn-error.log*
*.tsbuildinfo *.tsbuildinfo
.pnp.* .pnp.*
.yarn .yarn/*
!.yarn/patches !.yarn/patches
!.yarn/plugins !.yarn/plugins
!.yarn/releases !.yarn/releases

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,7 @@
yarnPath: .yarn/releases/yarn-3.2.4.cjs
nodeLinker: node-modules nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
yarnPath: .yarn/releases/yarn-3.2.4.cjs

View File

@ -3,9 +3,9 @@ WORKDIR /app
COPY .yarn ./.yarn COPY .yarn ./.yarn
COPY .yarnrc.yml ./ COPY .yarnrc.yml ./
COPY package.json yarn.lock ./ COPY package.json yarn.lock ./
COPY packages/web/package.json packages/web/package.json COPY apps/web/package.json apps/web/package.json
COPY packages/native/package.json packages/native/package.json COPY apps/mobile/package.json apps/mobile/package.json
COPY packages/app/package.json packages/app/package.json COPY packages/ui/package.json packages/ui/package.json
RUN yarn --immutable RUN yarn --immutable
COPY . . COPY . .
@ -17,11 +17,10 @@ RUN yarn build:web
FROM node:16-alpine FROM node:16-alpine
WORKDIR /app WORKDIR /app
COPY --from=builder /app/packages/web/.next/standalone . COPY --from=builder /app/apps/web/.next/standalone/apps/web .
COPY --from=builder /app/packages/web/.next/static ./.next/static/ COPY --from=builder /app/apps/web/.next/standalone/node_modules ./node_modules
COPY --from=builder /app/packages/web/public ./public COPY --from=builder /app/apps/web/.next/static ./.next/static/
# Waiting for https://github.com/vercel/next.js/discussions/39432 COPY --from=builder /app/apps/web/public ./public
# COPY --from=builder /app/packages/web/node_modules ./node_modules/
EXPOSE 8901 EXPOSE 8901
ENV PORT 8901 ENV PORT 8901

13
front/Dockerfile.dev Normal file
View File

@ -0,0 +1,13 @@
FROM node:16-alpine AS builder
WORKDIR /app
COPY .yarn ./.yarn
COPY .yarnrc.yml ./
COPY package.json yarn.lock ./
COPY apps/web/package.json apps/web/package.json
COPY apps/mobile/package.json apps/mobile/package.json
COPY packages/ui/package.json packages/ui/package.json
RUN yarn --immutable
EXPOSE 3000
EXPOSE 19000
CMD ["yarn", "dev"]

View File

@ -1,14 +0,0 @@
FROM node:16-alpine AS builder
WORKDIR /app
COPY .yarn ./.yarn
COPY .yarnrc.yml ./
COPY package.json yarn.lock ./
COPY packages/web/package.json packages/web/package.json
COPY packages/native/package.json packages/native/package.json
COPY packages/app/package.json packages/app/package.json
RUN yarn --immutable
EXPOSE 19000
ENV PORT 19000
CMD ["yarn", "native"]

View File

@ -1,15 +0,0 @@
FROM node:16-alpine AS builder
WORKDIR /app
COPY .yarn ./.yarn
COPY .yarnrc.yml ./
COPY package.json yarn.lock ./
COPY packages/web/package.json packages/web/package.json
COPY packages/native/package.json packages/native/package.json
COPY packages/app/package.json packages/app/package.json
RUN yarn --immutable
ENV NEXT_TELEMETRY_DISABLED 1
EXPOSE 3000
ENV PORT 3000
CMD ["yarn", "web"]

View File

@ -3,7 +3,7 @@
"version": "1.0.0", "version": "1.0.0",
"main": "src/app.tsx", "main": "src/app.tsx",
"scripts": { "scripts": {
"start": "expo start", "dev": "expo start",
"android": "expo start --android", "android": "expo start --android",
"ios": "expo start --ios", "ios": "expo start --ios",
"web": "expo start --web" "web": "expo start --web"

View File

@ -67,6 +67,9 @@ const nextConfig = {
locales: ["en", "fr"], locales: ["en", "fr"],
defaultLocale: "en", defaultLocale: "en",
}, },
experimental: {
outputFileTracingRoot: path.join(__dirname, '../../'),
}
}; };
if (process.env.NODE_ENV !== "production") { if (process.env.NODE_ENV !== "production") {

View File

@ -2,6 +2,7 @@
"name": "kyoo", "name": "kyoo",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "yarn workspaces foreach -pi run dev",
"web": "yarn workspace web dev", "web": "yarn workspace web dev",
"mobile": "yarn workspace mobile start", "mobile": "yarn workspace mobile start",
"build:web": "yarn workspace web build", "build:web": "yarn workspace web build",

View File

@ -1,5 +1,5 @@
import { Button } from "react-native"; import { Button } from "react-native";
export const Toto = () => { export const Toto = () => {
return <Button title="tato"></Button>; return <Button title="test"></Button>;
} }