feat: package docker img

master
Aravinth Manivannan 11 months ago
parent 20d34867cf
commit bfb7185801
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88

@ -0,0 +1,10 @@
/target
*/**/target
tarpaulin-report.html
.env
.env-sample
cobertura.xml
coverage/
node_modules/
/static/cache/bundle/*
scripts/creds.py

@ -0,0 +1,50 @@
#FROM node:16.11-bullseye-slim as frontend
#RUN apt-get update && apt-get install -y make
#COPY package.json yarn.lock /src/
#WORKDIR /src
#RUN yarn install
#COPY . .
#RUN make frontend
FROM rust:slim as rust
WORKDIR /src
RUN apt-get update && apt-get install -y git pkg-config libssl-dev
#RUN mkdir -p \
# /src/database/db-core/src \
# /src/database/db-sqlx-postgres/src \
# /src/database/db-sqlx-sqlite/src \
# /src/database/migrator/src \
# /src/src \
# /src/assets \
# /src/static
#RUN touch \
# /src/src/main.rs \
# /src/database/db-core/src/lib.rs \
# /src/database/db-sqlx-postgres/src/lib.rs \
# /src/database/db-sqlx-sqlite/src/lib.rs \
# /src/database/migrator/src/main.rs \
# /src/database/migrator/src/main.rs
#COPY Cargo.toml Cargo.lock /src/
#COPY ./database/db-core/Cargo.toml /src/database/db-core/
#COPY ./database/db-sqlx-postgres/Cargo.toml /src/database/db-sqlx-postgres/
#COPY ./database/db-sqlx-postgres/migrations/ /src/database/db-sqlx-postgres/
#COPY ./database/db-sqlx-sqlite/Cargo.toml /src/database/db-sqlx-sqlite/
#COPY ./database/db-sqlx-sqlite/migrations/ /src/database/db-sqlx-sqlite/
#COPY ./database/migrator/Cargo.toml /src/database/migrator/
#RUN cargo build --release || true
#COPY database/ /src/
COPY . /src/
RUN cargo build --release
FROM debian:bullseye-slim
RUN useradd -ms /bin/bash -u 1001 gitpad
WORKDIR /home/gitpad
COPY --from=rust /src/target/release/gitpad /usr/local/bin/
COPY --from=rust /src/config/default.toml /etc/gitpad/config.toml
USER gitpad
LABEL org.opencontainers.image.source https://github.com/realaravinth/gitpad
LABEL org.opencontainers.image.authors "Aravinth Manivannan"
LABEL org.opencontainers.image.license "AGPL-3.0-or-later"
LABEL org.opencontainers.image.title "GitPad"
LABEL org.opencontainers.image.description "Self-hosted GitHub Gists"
CMD [ "/usr/local/bin/gitpad" ]

@ -17,12 +17,12 @@ dev-env: ## Download development dependencies
doc: ## Prepare documentation
cargo doc --no-deps --workspace --all-features
#docker: ## Build docker images
# docker build -t realaravinth/gitpad:master -t realaravinth/gitpad:latest .
#
#docker-publish: docker ## Build and publish docker images
# docker push realaravinth/gitpad:master
# docker push realaravinth/gitpad:latest
docker: ## Build docker images
docker build -t realaravinth/gitpad:master -t realaravinth/gitpad:latest .
docker-publish: docker ## Build and publish docker images
docker push realaravinth/gitpad:master
docker push realaravinth/gitpad:latest
lint: ## Lint codebase
cargo fmt -v --all -- --emit files

Loading…
Cancel
Save