mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2025-06-06 14:16:39 +00:00
update dockerfile to make config
This commit is contained in:
parent
b2297eab6d
commit
5ac0b36255
21
Dockerfile
21
Dockerfile
@ -1,16 +1,21 @@
|
|||||||
FROM node:16.0.0 as frontend
|
FROM node:16.0.0 as frontend
|
||||||
|
RUN set -ex; \
|
||||||
|
apt-get update; \
|
||||||
|
DEBIAN_FRONTEND=noninteractive \
|
||||||
|
apt-get install -y --no-install-recommends make
|
||||||
|
RUN mkdir -p /src/docs/openapi/
|
||||||
COPY package.json yarn.lock /src/
|
COPY package.json yarn.lock /src/
|
||||||
|
COPY docs/openapi/package.json docs/openapi/yarn.lock /src/docs/openapi/
|
||||||
|
WORKDIR /src
|
||||||
|
RUN yarn install && cd docs/openapi && yarn install
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
RUN yarn install
|
|
||||||
WORKDIR /
|
|
||||||
RUN mkdir -p /src/static/cache/bundle
|
RUN mkdir -p /src/static/cache/bundle
|
||||||
COPY tsconfig.json webpack.config.js jest.config.ts /src/
|
COPY tsconfig.json webpack.config.js jest.config.ts /src/
|
||||||
COPY templates /src/templates
|
COPY templates /src/templates/
|
||||||
WORKDIR /src
|
COPY docs/openapi /src/docs/openapi/
|
||||||
RUN yarn build
|
COPY Makefile /src/
|
||||||
COPY scripts /src/scripts
|
COPY scripts /src/scripts
|
||||||
RUN /src/scripts/librejs.sh
|
RUN make frontend
|
||||||
RUN /src/scripts/cachebust.sh
|
|
||||||
|
|
||||||
FROM rust:latest as rust
|
FROM rust:latest as rust
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
@ -25,7 +30,7 @@ COPY src/settings.rs /src/src/settings.rs
|
|||||||
RUN cargo --version
|
RUN cargo --version
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
COPY . /src
|
COPY . /src
|
||||||
COPY --from=frontend /src/static/cache/bundle /src/static/cache/bundle
|
COPY --from=frontend /src/static/cache/bundle/ /src/static/cache/bundle/
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
||||||
FROM debian:bullseye
|
FROM debian:bullseye
|
||||||
|
14
Makefile
14
Makefile
@ -2,6 +2,11 @@ BUNDLE = static/cache/bundle
|
|||||||
OPENAPI = docs/openapi
|
OPENAPI = docs/openapi
|
||||||
CLEAN_UP = $(BUNDLE) src/cache_buster_data.json assets
|
CLEAN_UP = $(BUNDLE) src/cache_buster_data.json assets
|
||||||
|
|
||||||
|
define frontend_env ## install frontend deps
|
||||||
|
yarn install
|
||||||
|
cd docs/openapi && yarn install
|
||||||
|
endef
|
||||||
|
|
||||||
default: frontend ## Build app in debug mode
|
default: frontend ## Build app in debug mode
|
||||||
cargo build
|
cargo build
|
||||||
|
|
||||||
@ -26,10 +31,13 @@ docker-publish: docker ## Build and publish Docker image
|
|||||||
|
|
||||||
env: ## Setup development environtment
|
env: ## Setup development environtment
|
||||||
cargo fetch
|
cargo fetch
|
||||||
yarn install
|
$(call frontend_env)
|
||||||
cd docs/openapi && yarn install
|
|
||||||
|
|
||||||
frontend: env ## Build frontend
|
frontend-env: ## Install frontend deps
|
||||||
|
$(call frontend_env)
|
||||||
|
|
||||||
|
frontend: ## Build frontend
|
||||||
|
$(call frontend_env)
|
||||||
cd $(OPENAPI) && yarn build
|
cd $(OPENAPI) && yarn build
|
||||||
yarn install
|
yarn install
|
||||||
@-rm -rf $(BUNDLE)
|
@-rm -rf $(BUNDLE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user