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:
build:
context: ./front
dockerfile: Dockerfile.web.dev
dockerfile: Dockerfile.dev
volumes:
- ./front:/app
- /app/.yarn
- /app/node_modules
- /app/packages/web/.next/
- /app/apps/web/.next/
- /app/apps/mobile/.expo/
ports:
- "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"
restart: on-failure
environment:

View File

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

2
front/.gitignore vendored
View File

@ -35,7 +35,7 @@ yarn-error.log*
*.tsbuildinfo
.pnp.*
.yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.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
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 .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
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
COPY . .
@ -17,11 +17,10 @@ RUN yarn build:web
FROM node:16-alpine
WORKDIR /app
COPY --from=builder /app/packages/web/.next/standalone .
COPY --from=builder /app/packages/web/.next/static ./.next/static/
COPY --from=builder /app/packages/web/public ./public
# Waiting for https://github.com/vercel/next.js/discussions/39432
# COPY --from=builder /app/packages/web/node_modules ./node_modules/
COPY --from=builder /app/apps/web/.next/standalone/apps/web .
COPY --from=builder /app/apps/web/.next/standalone/node_modules ./node_modules
COPY --from=builder /app/apps/web/.next/static ./.next/static/
COPY --from=builder /app/apps/web/public ./public
EXPOSE 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",
"main": "src/app.tsx",
"scripts": {
"start": "expo start",
"dev": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"

View File

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

View File

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

View File

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