mirror of
https://github.com/OMGeeky/twba.uploader.git
synced 2026-02-23 15:49:58 +01:00
remove docker stuff
(its in docker compose one layer up)
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
|
||||
<deployment type="dockerfile">
|
||||
<settings>
|
||||
<option name="imageTag" value="twba-uploader" />
|
||||
<option name="buildArgs">
|
||||
<list>
|
||||
<DockerEnvVarImpl>
|
||||
<option name="name" value="PROGNAME" />
|
||||
<option name="value" value="twba-uploader" />
|
||||
</DockerEnvVarImpl>
|
||||
</list>
|
||||
</option>
|
||||
<option name="buildKitEnabled" value="true" />
|
||||
<option name="containerName" value="twba-uploader" />
|
||||
<option name="envVars">
|
||||
<list>
|
||||
<DockerEnvVarImpl>
|
||||
<option name="name" value="TWBA_CONFIG" />
|
||||
<option name="value" value="/twba/configs/config.toml" />
|
||||
</DockerEnvVarImpl>
|
||||
</list>
|
||||
</option>
|
||||
<option name="commandLineOptions" value="--restart=unless-stopped" />
|
||||
<option name="showCommandPreview" value="true" />
|
||||
<option name="sourceFilePath" value="Dockerfile" />
|
||||
<option name="volumeBindings">
|
||||
<list>
|
||||
<DockerVolumeBindingImpl>
|
||||
<option name="containerPath" value="/twba/configs/" />
|
||||
<option name="hostPath" value="/twba/" />
|
||||
<option name="readOnly" value="true" />
|
||||
</DockerVolumeBindingImpl>
|
||||
<DockerVolumeBindingImpl>
|
||||
<option name="containerPath" value="/twba/tmp/" />
|
||||
<option name="hostPath" value="/var/tmp/twba/" />
|
||||
</DockerVolumeBindingImpl>
|
||||
<DockerVolumeBindingImpl>
|
||||
<option name="containerPath" value="/twba/data/" />
|
||||
<option name="hostPath" value="/twba/data/" />
|
||||
</DockerVolumeBindingImpl>
|
||||
<DockerVolumeBindingImpl>
|
||||
<option name="containerPath" value="/etc/ssl/certs" />
|
||||
<option name="hostPath" value="/etc/ssl/certs" />
|
||||
<option name="readOnly" value="true" />
|
||||
</DockerVolumeBindingImpl>
|
||||
</list>
|
||||
</option>
|
||||
</settings>
|
||||
</deployment>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
46
Dockerfile
46
Dockerfile
@@ -1,46 +0,0 @@
|
||||
FROM lukemathwalker/cargo-chef:0.1.66-rust-1 AS chef
|
||||
WORKDIR /app
|
||||
|
||||
FROM chef AS planner
|
||||
COPY /src ./src
|
||||
COPY /.cargo ./.cargo
|
||||
COPY /Cargo.toml .
|
||||
COPY /Cargo.lock .
|
||||
RUN cargo chef prepare --recipe-path recipe.json
|
||||
|
||||
FROM chef AS builder
|
||||
COPY --from=planner /app/recipe.json recipe.json
|
||||
# Build dependencies - this is the caching Docker layer!
|
||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||||
--mount=type=cache,target=/home/root/app/target \
|
||||
cargo chef cook --release --locked --recipe-path recipe.json
|
||||
# Build application
|
||||
COPY /src ./src
|
||||
COPY /.cargo ./.cargo
|
||||
COPY /Cargo.toml .
|
||||
COPY /Cargo.lock .
|
||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||||
--mount=type=cache,target=/home/root/app/target \
|
||||
cargo build --release --locked
|
||||
|
||||
# We do not need the Rust toolchain to run the binary!
|
||||
FROM debian:bookworm-20240423 AS runtime
|
||||
WORKDIR /app
|
||||
ARG PROGNAME
|
||||
RUN apt-get update && apt-get install -y libssl-dev coreutils ffmpeg
|
||||
# Create a script to run the command and sleep for one hour after the command is done
|
||||
RUN echo "#!/bin/bash \n \
|
||||
echo \"Running command: '$PROGNAME'\" \n \
|
||||
# Run your command \n \
|
||||
$PROGNAME \n \
|
||||
echo \"Done with normal command. Sleeping for one hour\" \n \
|
||||
# Sleep for one hour \n \
|
||||
sleep 3600 \n \
|
||||
echo \"Done with sleep. Exiting\" \
|
||||
" > /app/entrypoint.sh
|
||||
|
||||
# Make the script executable
|
||||
RUN chmod +x /app/entrypoint.sh
|
||||
COPY --from=builder /app/target/release/$PROGNAME /usr/local/bin/$PROGNAME
|
||||
|
||||
CMD ["/app/entrypoint.sh"]
|
||||
39
compose.yaml
39
compose.yaml
@@ -1,39 +0,0 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
uploader:
|
||||
build:
|
||||
context: .
|
||||
volumes:
|
||||
- data:/etc/twba/
|
||||
- files:/var/tmp/twba/files
|
||||
environment:
|
||||
- TWBA_CONFIG=/etc/twba/config.toml
|
||||
# web:
|
||||
# im age: tw
|
||||
|
||||
debug:
|
||||
image: debian:stable-slim
|
||||
command:
|
||||
- /bin/bash
|
||||
stdin_open: true
|
||||
tty: true
|
||||
restart: "no"
|
||||
volumes:
|
||||
- data:/etc/twba/
|
||||
- files:/var/tmp/twba/files
|
||||
profiles:
|
||||
- no-autostart
|
||||
volumes:
|
||||
data:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: "none"
|
||||
o: "bind"
|
||||
device: "/etc/twba/"
|
||||
files:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: "none"
|
||||
o: "bind"
|
||||
device: "/var/tmp/twba/"
|
||||
Reference in New Issue
Block a user