Skip to content

Commit febd150

Browse files
committed
Created Dockerfile and fly config + fixed Flexbox issue
1 parent 309d840 commit febd150

16 files changed

+441
-54
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
target
2+
build

Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM rust:latest as wasm-build
2+
3+
RUN mkdir -p /usr/build/
4+
WORKDIR /usr/build/
5+
6+
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
7+
8+
COPY . .
9+
10+
WORKDIR /usr/build/harper-wasm
11+
RUN wasm-pack build --release
12+
13+
FROM node:slim as node-build
14+
15+
RUN mkdir -p /usr/build/
16+
WORKDIR /usr/build/
17+
18+
RUN mkdir harper-wasm
19+
20+
COPY --from=wasm-build /usr/build/harper-wasm/pkg /usr/build/harper-wasm/pkg
21+
COPY web web
22+
COPY alice.txt .
23+
24+
WORKDIR /usr/build/web
25+
26+
RUN yarn install && yarn build
27+
28+
FROM node:slim
29+
30+
COPY --from=node-build /usr/build/web/build /usr/build/web/build
31+
COPY --from=node-build /usr/build/web/package.json /usr/build/web/package.json
32+
COPY --from=node-build /usr/build/web/yarn.lock /usr/build/web/yarn.lock
33+
COPY --from=node-build /usr/build/web/node_modules /usr/build/web/node_modules
34+
35+
WORKDIR /usr/build/web
36+
37+
RUN yarn install
38+
39+
ENV HOST=0.0.0.0
40+
ENV PORT=3000
41+
42+
ENTRYPOINT ["node", "build"]

build.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

english_words.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6841,7 +6841,6 @@ aionial
68416841
ayont
68426842
ayous
68436843
air
6844-
aira
68456844
airable
68466845
airampo
68476846
airan

fly.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
app = "writewithharper"
2+
primary_region = "den"
3+
4+
[build]
5+
6+
[http_service]
7+
internal_port = 3000
8+
force_https = true
9+
auto_stop_machines = true
10+
auto_start_machines = true
11+
min_machines_running = 1
12+
processes = ["app"]
13+
14+
[[vm]]
15+
cpu_kind = "shared"
16+
cpus = 1
17+
memory_mb = 256

harper-wasm/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ edition = "2021"
66
[lib]
77
crate-type = ["cdylib", "rlib"]
88

9+
[profile.release]
10+
opt-level = "s"
11+
strip = true
12+
913
[dependencies]
1014
console_error_panic_hook = "0.1.7"
1115
tracing = "0.1.40"

web/.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
vite.config.js.timestamp-*
10+
vite.config.ts.timestamp-*

web/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"format": "prettier --plugin-search-dir . --write ."
1313
},
1414
"devDependencies": {
15-
"@sveltejs/adapter-auto": "^2.0.0",
15+
"@flydotio/dockerfile": "^0.5.0",
16+
"@sveltejs/adapter-node": "^3.0.0",
1617
"@sveltejs/kit": "^1.20.4",
1718
"@typescript-eslint/eslint-plugin": "^6.0.0",
1819
"@typescript-eslint/parser": "^6.0.0",

web/src/app.css

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
position: relative;
1717
}
1818

19-
.underlinespecial:after {
19+
.underlinespecial::after {
2020
transition-property: all;
2121
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
2222
transition-duration: 150ms;
@@ -30,3 +30,26 @@
3030
bottom: -3px;
3131
left: 0;
3232
}
33+
34+
textarea {
35+
--tw-ring-shadow: 0 0 #000 !important;
36+
}
37+
38+
.animate-bigbounce{
39+
animation: bigbounce 1s infinite;
40+
}
41+
42+
.animate-after-bigbounce::after {
43+
animation: bigbounce 1s infinite;
44+
}
45+
46+
@keyframes bigbounce {
47+
0%, 100% {
48+
transform: translateY(-40%);
49+
animation-timing-function: cubic-bezier(0.8,0,1,1);
50+
}
51+
50% {
52+
transform: none;
53+
animation-timing-function: cubic-bezier(0,0,0.2,1);
54+
}
55+
}

web/src/app.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
%sveltekit.head%
99
</head>
1010

11-
<body data-sveltekit-preload-data="hover">
12-
<div style="display: contents">%sveltekit.body%</div>
11+
<body data-sveltekit-preload-data="hover" class="m-0 p-0 w-full h-full">
12+
<div style="display: contents" class="m-0 p-0 w-full h-full">%sveltekit.body%</div>
1313
</body>
1414

1515
</html>

0 commit comments

Comments
 (0)