mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2025-03-30 15:08:29 +00:00
Docker: update image and optimize for layer caching
This commit is contained in:
parent
eedec7da34
commit
1883ef1c1c
19
Dockerfile
19
Dockerfile
@ -7,7 +7,7 @@ COPY browser/ /browser
|
||||
WORKDIR /browser
|
||||
RUN wasm-pack build --release
|
||||
|
||||
FROM node:14.16.0 as frontend
|
||||
FROM node:16.0.0 as frontend
|
||||
COPY package.json yarn.lock /src/
|
||||
COPY --from=wasm /browser /src/browser
|
||||
WORKDIR /src
|
||||
@ -18,14 +18,27 @@ COPY tsconfig.json webpack.config.js jest.config.ts /src/
|
||||
COPY templates /src/templates
|
||||
WORKDIR /src
|
||||
RUN yarn build
|
||||
COPY scripts /src/scripts
|
||||
RUN /src/scripts/librejs.sh
|
||||
|
||||
FROM rust:latest as rust
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
RUN mkdir src && echo "fn main() {}" > src/main.rs
|
||||
COPY Cargo.toml .
|
||||
RUN sed -i '/.*build.rs.*/d' Cargo.toml
|
||||
RUN sed -i '/.*browser.*/d' Cargo.toml
|
||||
COPY Cargo.lock .
|
||||
COPY migrations /src/migrations
|
||||
COPY sqlx-data.json /src/
|
||||
COPY src/tests-migrate.rs /src/src/tests-migrate.rs
|
||||
COPY src/settings.rs /src/src/settings.rs
|
||||
RUN cargo --version
|
||||
RUN cargo build --release
|
||||
COPY . /src
|
||||
COPY --from=frontend /src/static/cache/bundle /src/static/cache/bundle
|
||||
RUN cargo build --release
|
||||
|
||||
FROM debian:buster
|
||||
FROM debian:bullseye
|
||||
RUN useradd -ms /bin/bash -u 1001 mcaptcha
|
||||
WORKDIR /home/mcaptcha
|
||||
COPY --from=rust /src/target/release/mcaptcha /usr/local/bin/
|
||||
|
@ -9,6 +9,7 @@ Proof of work based, privacy respecting CAPTCHA system with a kickass UX.
|
||||
|
||||
[](https://mcaptcha.github.io/mCaptcha/mCaptcha/)
|
||||
[](https://github.com/mCaptcha/mCaptcha/actions/workflows/linux.yml)
|
||||
[](https://hub.docker.com/r/mcaptcha/mcaptcha)
|
||||
[](https://deps.rs/repo/github/mCaptcha/mCaptcha)
|
||||
[](https://codecov.io/gh/mCaptcha/mCaptcha)
|
||||
<br />
|
||||
|
@ -2,6 +2,7 @@
|
||||
"name": "vanilla",
|
||||
"main": "index.js",
|
||||
"version": "1.0.0",
|
||||
"license": "AGPL-3.0",
|
||||
"scripts": {
|
||||
"build": "webpack --mode production",
|
||||
"lint": "yarn run eslint templates",
|
||||
|
@ -5,9 +5,9 @@ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
||||
//const WasmPackPlugin = require('@wasm-tool/wasm-pack-plugin');
|
||||
|
||||
module.exports = {
|
||||
devtool: 'inline-source-map',
|
||||
mode: 'development',
|
||||
//mode: 'production',
|
||||
//devtool: 'inline-source-map',
|
||||
//mode: 'development',
|
||||
mode: 'production',
|
||||
entry: {
|
||||
bundle: './templates/index.ts',
|
||||
mobile: './templates/mobile.ts',
|
||||
|
Loading…
x
Reference in New Issue
Block a user