-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
115 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.git | ||
.github | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM docker.io/rust:1-slim-bullseye AS build | ||
WORKDIR /app | ||
|
||
RUN apt update && apt upgrade && apt install -y pkg-config libssl-dev | ||
|
||
COPY src /app/src | ||
COPY build.rs Cargo.toml Cargo.lock /app/ | ||
|
||
RUN cargo build --locked --release --features http | ||
RUN cp ./target/release/waifu-server /bin/server | ||
|
||
FROM docker.io/debian:bullseye-slim AS final | ||
|
||
RUN apt update && apt upgrade && apt install -y ca-certificates curl && apt-get clean | ||
|
||
# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/ | ||
ARG UID=10001 | ||
RUN adduser \ | ||
--disabled-password \ | ||
--gecos "" \ | ||
--home "/nonexistent" \ | ||
--shell "/sbin/nologin" \ | ||
--no-create-home \ | ||
--uid "${UID}" \ | ||
appuser | ||
USER appuser | ||
|
||
COPY --from=build /bin/server /bin/ | ||
|
||
COPY assets /usr/local/share/waifu/assets | ||
COPY templates /usr/local/share/waifu/templates | ||
|
||
EXPOSE 8080 | ||
|
||
ENV WAIFU_ASSETS=/usr/local/share/waifu | ||
ENV RUST_LOG=info | ||
|
||
CMD ["/bin/server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# fly.toml app configuration file generated for waifu-calendar on 2024-01-20T21:55:32-07:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = "waifu-calendar" | ||
primary_region = "ord" | ||
|
||
[build] | ||
|
||
[http_service] | ||
internal_port = 8080 | ||
force_https = true | ||
auto_stop_machines = true | ||
auto_start_machines = true | ||
min_machines_running = 0 | ||
processes = ["app"] | ||
|
||
[[vm]] | ||
cpu_kind = "shared" | ||
cpus = 1 | ||
memory_mb = 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters