wip fix
This commit is contained in:
parent
7aa0ab468e
commit
013ac47b4f
|
|
@ -175,3 +175,4 @@ dist
|
|||
.DS_Store
|
||||
|
||||
app/*
|
||||
.data
|
||||
|
|
@ -4,13 +4,9 @@ WORKDIR /app/prasi
|
|||
RUN apt-get update
|
||||
RUN apt-get install unzip
|
||||
|
||||
COPY pkgs/docker-prep.ts .
|
||||
RUN bun docker-prep.ts
|
||||
WORKDIR /app/prasi/_tmp_docker
|
||||
COPY dockerzip .
|
||||
RUN unzip dockerzip
|
||||
RUN bun install
|
||||
COPY _tmp_docker/node_modules .
|
||||
WORKDIR /app/prasi
|
||||
RUN rm -rf _tmp_docker
|
||||
COPY . .
|
||||
|
||||
EXPOSE 3000/tcp
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
import { $ } from "execa";
|
||||
import fs from "fs";
|
||||
import { copyAsync, dirAsync, removeAsync } from "fs-jetpack";
|
||||
import {
|
||||
copyAsync,
|
||||
dirAsync,
|
||||
existsAsync,
|
||||
removeAsync,
|
||||
renameAsync,
|
||||
} from "fs-jetpack";
|
||||
import path from "path";
|
||||
|
||||
const dir = {
|
||||
|
|
@ -30,13 +37,18 @@ const dir = {
|
|||
},
|
||||
};
|
||||
|
||||
await removeAsync(dir.path("_tmp_docker"));
|
||||
for (const file of Object.keys(dir.read(dir.path``))) {
|
||||
if (!(await existsAsync(dir.path("_tmp_docker")))) {
|
||||
for (const file of Object.keys(dir.read(dir.path``))) {
|
||||
if (file.endsWith("package.json")) {
|
||||
await dirAsync(dir.path("_tmp_docker", path.dirname(file)));
|
||||
await copyAsync(dir.path(file), dir.path("_tmp_docker", file), {
|
||||
overwrite: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
await copyAsync(dir.path("bun.lockb"), dir.path("_tmp_docker", "bun.lockb"));
|
||||
|
||||
await $({ cwd: dir.path("_tmp_docker") })`zip -r ../docker .`;
|
||||
await $`mv docker.zip dockerzip`;
|
||||
await removeAsync(dir.path("_tmp_docker"));
|
||||
}
|
||||
await copyAsync(dir.path("bun.lockb"), dir.path("_tmp_docker", "bun.lockb"));
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { dirAsync, existsAsync } from "fs-jetpack";
|
|||
import { dir } from "utils/dir";
|
||||
import { $ } from "execa";
|
||||
|
||||
import "./docker-prep";
|
||||
|
||||
g.mode = process.argv.includes("dev") ? "dev" : "prod";
|
||||
g.datadir = g.mode === "prod" ? "../data" : ".data";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue