Fixing earthfile

This commit is contained in:
Fabian Stamm 2023-06-08 16:33:34 +02:00
parent 3ab6fc97e9
commit 012d0fe823
6 changed files with 61 additions and 17 deletions

View File

@ -1,17 +0,0 @@
FROM node:12
LABEL maintainer="Fabian Stamm <dev@fabianstamm.de>"
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
RUN npm config set registry https://npm.hibas123.de
COPY ["package.json", "tsconfig.json", "/usr/src/app/"]
RUN npm install
COPY src/ /usr/src/app/src
COPY public/ /usr/src/app/public
EXPOSE 3000/tcp
CMD ["npm", "run", "start"]

18
Earthfile Normal file
View File

@ -0,0 +1,18 @@
VERSION 0.7
FROM node:lts-alpine3.18
WORKDIR /build
docker-multi:
BUILD --platform linux/amd64 --platform linux/arm64 +docker
docker:
COPY package.json tsconfig.json .
COPY src ./src
COPY public ./public
RUN yarn install
RUN yarn build
WORKDIR /build
ENTRYPOINT ["node", "lib/index.js"]
ARG EARTHLY_TARGET_TAG
ARG TAG=$EARTHLY_TARGET_TAG
SAVE IMAGE --push docker.hibas123.de/screenshare:$TAG

View File

@ -1,7 +1,9 @@
{ {
"name": "ScreenSharingThing", "name": "ScreenSharingThing",
"packageManager": "yarn@3.1.1", "packageManager": "yarn@3.1.1",
"version": "0.1.0",
"scripts": { "scripts": {
"build": "tsc",
"dev": "ts-node src/index.ts" "dev": "ts-node src/index.ts"
}, },
"devDependencies": { "devDependencies": {

19
public/design.html Normal file
View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Simple Screen Sharing</title>
<link href="./styles.css" rel="stylesheet">
</head>
<body class="desktop">
<div class="container">
<div class="video">
VIDEO
</div>
<div class="chat">
CHAT
</div>
</div>
</body>
</html>

21
public/styles.css Normal file
View File

@ -0,0 +1,21 @@
.desktop .container {
display: grid;
grid-template-columns: 1fr auto;
grid-template-rows: 1fr;
grid-template-areas: "video chat";
}
.mobile .container {
display: grid;
grid-template-columns: 1fr;
grid-template-rows: auto 1fr;
grid-template-areas: "video" "chat";
}
.video {
grid-area: video;
}
.chat {
grid-area: chat;
}

View File

@ -1,5 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"outDir": "lib",
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"module": "commonjs" /* Specify what module code is generated. */, "module": "commonjs" /* Specify what module code is generated. */,
"moduleResolution": "node" /* Specify how the compiler resolves module names. */, "moduleResolution": "node" /* Specify how the compiler resolves module names. */,