mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2025-02-16 16:39:46 +03:00
Dockerfile init
This commit is contained in:
parent
6964faf8f4
commit
e9c84b4ed4
4 changed files with 45 additions and 3 deletions
12
.dockerignore
Normal file
12
.dockerignore
Normal file
|
@ -0,0 +1,12 @@
|
|||
/target
|
||||
tarpaulin-report.html
|
||||
.env
|
||||
.env
|
||||
cobertura.xml
|
||||
prod/
|
||||
node_modules/
|
||||
/static-assets/bundle
|
||||
/static
|
||||
./templates/**/*.js
|
||||
/static-assets/bundle/*
|
||||
src/cache_buster_data.json
|
30
Dockerfile
Normal file
30
Dockerfile
Normal file
|
@ -0,0 +1,30 @@
|
|||
FROM node:10.24 as frontend
|
||||
|
||||
COPY . /build-frontend
|
||||
|
||||
FROM debian:buster
|
||||
|
||||
LABEL org.opencontainers.image.source https://github.com/mCaptcha/guard
|
||||
|
||||
RUN set -ex; \
|
||||
apt-get update; \
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get install -y --no-install-recommends yarnpkg npm ca-certificates make libssl-dev; \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
WORKDIR /build-frontend
|
||||
RUN pwd
|
||||
RUN cd /build-frontend && npm install
|
||||
RUN cd /build-frontend && npm build
|
||||
|
||||
|
||||
FROM rust:latest as build
|
||||
WORKDIR /
|
||||
COPY --from=0 /build-frontend /src
|
||||
RUN cargo install --path /src
|
||||
RUN useradd -ms /bin/bash -u 1001 guard
|
||||
WORKDIR /home/guard
|
||||
USER guard
|
||||
EXPOSE 7000
|
||||
ENTRYPOINT [ "/usr/local/cargo/bin/guard" ]
|
4
Makefile
4
Makefile
|
@ -40,8 +40,8 @@ migrate:
|
|||
help:
|
||||
@echo ' run - run developer instance'
|
||||
@echo ' test - run unit and integration tests'
|
||||
@echo ' frontend-dev - build static assets in dev mode'
|
||||
@echo ' frontend - build static assets in prod mode'
|
||||
@echo ' frontend-dev - build static assets in dev mode'
|
||||
@echo ' frontend - build static assets in prod mode'
|
||||
@echo ' migrate - run database migrations'
|
||||
@echo ' dev-env - download dependencies'
|
||||
@echo ' docs - build documentation'
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"scripts": {
|
||||
"start": "tsc templates/index.ts && webpack --config webpack.dev.js",
|
||||
"tsc": "tsc templates/index.ts",
|
||||
"build": "webpack --config webpack.prod.js"
|
||||
"build": "tsc templates/index.ts && webpack --config webpack.prod.js"
|
||||
},
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
|
|
Loading…
Add table
Reference in a new issue