mirror of
https://github.com/plausible/analytics.git
synced 2024-11-26 00:24:44 +03:00
Update dockerfile for build options (#3567)
* Update dockerfile for build options * Start permanent on small * Default to small * Default to small fixup
This commit is contained in:
parent
8dfaad56f0
commit
bd7deb5631
1
.github/workflows/build-private-images.yml
vendored
1
.github/workflows/build-private-images.yml
vendored
@ -47,6 +47,7 @@ jobs:
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
build-args: |
|
||||
MIX_ENV=prod
|
||||
BUILD_METADATA=${{ steps.meta.outputs.json }}
|
||||
|
||||
- name: Image digest
|
||||
|
1
.github/workflows/build-public-images.yml
vendored
1
.github/workflows/build-public-images.yml
vendored
@ -46,6 +46,7 @@ jobs:
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
build-args: |
|
||||
MIX_ENV=small
|
||||
BUILD_METADATA=${{ steps.meta.outputs.json }}
|
||||
ERL_FLAGS=+JPperf true
|
||||
|
||||
|
@ -4,8 +4,10 @@
|
||||
#### Builder
|
||||
FROM hexpm/elixir:1.15.7-erlang-26.1.2-alpine-3.18.4 as buildcontainer
|
||||
|
||||
ARG MIX_ENV=small
|
||||
|
||||
# preparation
|
||||
ENV MIX_ENV=prod
|
||||
ENV MIX_ENV=$MIX_ENV
|
||||
ENV NODE_ENV=production
|
||||
ENV NODE_OPTIONS=--openssl-legacy-provider
|
||||
|
||||
@ -59,6 +61,8 @@ LABEL maintainer="plausible.io <hello@plausible.io>"
|
||||
ARG BUILD_METADATA={}
|
||||
ENV BUILD_METADATA=$BUILD_METADATA
|
||||
ENV LANG=C.UTF-8
|
||||
ARG MIX_ENV=small
|
||||
ENV MIX_ENV=$MIX_ENV
|
||||
|
||||
RUN apk upgrade --no-cache
|
||||
|
||||
@ -69,7 +73,7 @@ COPY ./rel/docker-entrypoint.sh /entrypoint.sh
|
||||
RUN chmod a+x /entrypoint.sh && \
|
||||
adduser -h /app -u 1000 -s /bin/sh -D plausibleuser
|
||||
|
||||
COPY --from=buildcontainer /app/_build/prod/rel/plausible /app
|
||||
COPY --from=buildcontainer /app/_build/${MIX_ENV}/rel/plausible /app
|
||||
RUN chown -R plausibleuser:plausibleuser /app
|
||||
USER plausibleuser
|
||||
WORKDIR /app
|
||||
|
2
mix.exs
2
mix.exs
@ -10,7 +10,7 @@ defmodule Plausible.MixProject do
|
||||
version: System.get_env("APP_VERSION", "0.0.1"),
|
||||
elixir: "~> 1.14",
|
||||
elixirc_paths: elixirc_paths(Mix.env()),
|
||||
start_permanent: Mix.env() == :prod,
|
||||
start_permanent: Mix.env() in [:prod, :small],
|
||||
aliases: aliases(),
|
||||
deps: deps(),
|
||||
test_coverage: [
|
||||
|
Loading…
Reference in New Issue
Block a user