Dockerfile
· 799 B · Docker
Eredeti
FROM alpine:3.22
ARG TARGETARCH
ENV FLAVOUR=${TARGETARCH}-musl
ENV GROUP=akkoma
ENV USER=akkoma
ENV MIX_ENV=prod
RUN awk 'NR==2' /etc/apk/repositories | sed 's/main/community/' | tee -a /etc/apk/repositories
RUN apk update
RUN apk add curl unzip ncurses file-dev
RUN apk add imagemagick ffmpeg exiftool
RUN addgroup -S $GROUP && adduser -S $USER -G $GROUP
RUN mkdir /etc/akkoma
COPY --chown=$USER:$GROUP --chmod=600 config.exs /etc/akkoma/
RUN mkdir -p /opt/akkoma
RUN chown $USER /opt/akkoma
USER $USER
WORKDIR /opt/akkoma
RUN curl https://akkoma-updates.s3-website.fr-par.scw.cloud/stable/akkoma-$FLAVOUR.zip -o /tmp/akkoma.zip && \
unzip /tmp/akkoma.zip -d /tmp && \
mv /tmp/release/* /opt/akkoma/
COPY --chown=$USER:$GROUP start.sh /opt/akkoma
CMD ["/opt/akkoma/start.sh"]
| 1 | FROM alpine:3.22 |
| 2 | |
| 3 | ARG TARGETARCH |
| 4 | |
| 5 | ENV FLAVOUR=${TARGETARCH}-musl |
| 6 | |
| 7 | ENV GROUP=akkoma |
| 8 | ENV USER=akkoma |
| 9 | |
| 10 | ENV MIX_ENV=prod |
| 11 | |
| 12 | RUN awk 'NR==2' /etc/apk/repositories | sed 's/main/community/' | tee -a /etc/apk/repositories |
| 13 | |
| 14 | RUN apk update |
| 15 | RUN apk add curl unzip ncurses file-dev |
| 16 | RUN apk add imagemagick ffmpeg exiftool |
| 17 | |
| 18 | RUN addgroup -S $GROUP && adduser -S $USER -G $GROUP |
| 19 | |
| 20 | RUN mkdir /etc/akkoma |
| 21 | |
| 22 | COPY --chown=$USER:$GROUP --chmod=600 config.exs /etc/akkoma/ |
| 23 | |
| 24 | RUN mkdir -p /opt/akkoma |
| 25 | RUN chown $USER /opt/akkoma |
| 26 | |
| 27 | USER $USER |
| 28 | |
| 29 | WORKDIR /opt/akkoma |
| 30 | |
| 31 | RUN curl https://akkoma-updates.s3-website.fr-par.scw.cloud/stable/akkoma-$FLAVOUR.zip -o /tmp/akkoma.zip && \ |
| 32 | unzip /tmp/akkoma.zip -d /tmp && \ |
| 33 | mv /tmp/release/* /opt/akkoma/ |
| 34 | |
| 35 | COPY --chown=$USER:$GROUP start.sh /opt/akkoma |
| 36 | |
| 37 | CMD ["/opt/akkoma/start.sh"] |
docker-compose.yml
· 1.1 KiB · YAML
Eredeti
services:
db:
image: postgres:16-alpine
shm_size: 4gb
restart: unless-stopped
environment: {
# This might seem insecure but is usually not a problem.
# You should leave this at the "akkoma" default.
# The DB is only reachable by containers in the same docker network,
# and is not exposed to the open internet.
#
# If you do change this, remember to update "config.exs".
POSTGRES_DB: akkoma,
POSTGRES_USER: akkoma,
POSTGRES_PASSWORD: akkoma,
}
volumes:
- ./data:/var/lib/postgresql/data/
akkoma:
image: akkoma:latest
build: .
restart: unless-stopped
links:
- db
ports: [
# Uncomment/Change port mappings below as needed.
# The left side is your host machine, the right one is the akkoma container.
# You can prefix the left side with an ip.
# Webserver (for reverse-proxies outside of docker)
# If you use a dockerized proxy, you can leave this commented
# and use a container link instead.
"127.0.0.1:4000:4000",
]
volumes:
- ./static:/opt/akkoma/static
- ./uploads:/opt/akkoma/uploads
| 1 | services: |
| 2 | db: |
| 3 | image: postgres:16-alpine |
| 4 | shm_size: 4gb |
| 5 | restart: unless-stopped |
| 6 | environment: { |
| 7 | # This might seem insecure but is usually not a problem. |
| 8 | # You should leave this at the "akkoma" default. |
| 9 | # The DB is only reachable by containers in the same docker network, |
| 10 | # and is not exposed to the open internet. |
| 11 | # |
| 12 | # If you do change this, remember to update "config.exs". |
| 13 | POSTGRES_DB: akkoma, |
| 14 | POSTGRES_USER: akkoma, |
| 15 | POSTGRES_PASSWORD: akkoma, |
| 16 | } |
| 17 | volumes: |
| 18 | - ./data:/var/lib/postgresql/data/ |
| 19 | |
| 20 | akkoma: |
| 21 | image: akkoma:latest |
| 22 | build: . |
| 23 | restart: unless-stopped |
| 24 | links: |
| 25 | - db |
| 26 | ports: [ |
| 27 | # Uncomment/Change port mappings below as needed. |
| 28 | # The left side is your host machine, the right one is the akkoma container. |
| 29 | # You can prefix the left side with an ip. |
| 30 | |
| 31 | # Webserver (for reverse-proxies outside of docker) |
| 32 | # If you use a dockerized proxy, you can leave this commented |
| 33 | # and use a container link instead. |
| 34 | "127.0.0.1:4000:4000", |
| 35 | ] |
| 36 | volumes: |
| 37 | - ./static:/opt/akkoma/static |
| 38 | - ./uploads:/opt/akkoma/uploads |