Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use debian docker image #17

Merged
merged 2 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
erlang 24.0.5
erlang 24.2.2
elixir 1.13.1-otp-24
34 changes: 19 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
FROM elixir:1.13.1-slim AS builder

FROM elixir:1.13-alpine AS builder

RUN apk add --no-cache git openssh-client
# Install dependencies
RUN set -xe; \
apt-get update && apt-get install -y \
build-essential \
ca-certificates \
git \
openssh-client;

WORKDIR /tmp/beebee

Expand All @@ -20,7 +25,7 @@ COPY rel ./rel

RUN MIX_ENV=prod mix release

FROM alpine:3.16
FROM debian:11.6-slim

# These are fed in from the build script
ARG VCS_REF
Expand All @@ -31,28 +36,27 @@ LABEL \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.description="URL shortener for http://s76.co" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.source="https://github.com/pop-os/warehouse" \
org.opencontainers.image.source="https://github.com/system76/beebee" \
org.opencontainers.image.title="beebee" \
org.opencontainers.image.vendor="system76" \
org.opencontainers.image.version="${VERSION}"

RUN apk update && \
apk add --no-cache \
git \
bash \
libgcc \
libstdc++ \
ca-certificates \
ncurses-libs \
openssl
RUN set -xe; \
apt-get update && apt-get install -y \
ca-certificates \
libmcrypt4 \
openssl;

RUN addgroup -S beebee && adduser -S beebee -G beebee
RUN set -xe; \
adduser --uid 1000 --system --home /beebee --shell /bin/sh --group beebee;

COPY --from=builder /tmp/beebee/_build/prod/rel/beebee ./

RUN chown -R beebee:beebee bin/beebee releases/
RUN chown -R beebee:beebee `ls | grep 'erts-'`/

ENV LANG=C.UTF-8

USER beebee

EXPOSE 4000
Expand Down
16 changes: 16 additions & 0 deletions api.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
POST /_add HTTP/1.1
Host: localhost:4002
Authorization: Basic dXNlcjpwYXNzd29yZA==
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iex(1)> Base.encode64("user:password")
"dXNlcjpwYXNzd29yZA=="

Content-Type: application/json
Content-Length: 58

{
"url": "https://github.com",
"short_tag": "github"
}

###

GET /_stats HTTP/1.1
Host: localhost:4002
Authorization: Basic dXNlcjpwYXNzd29yZA==
Loading