Skip to content

Commit

Permalink
DockerFile Lufi
Browse files Browse the repository at this point in the history
  • Loading branch information
syji35 committed Nov 21, 2023
1 parent c9cde07 commit fde0eea
Show file tree
Hide file tree
Showing 5 changed files with 515 additions and 1 deletion.
81 changes: 81 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Build Docker

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
branches: ["main", "develop"]


env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository_owner }}/lufi


jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v3


# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Lufi Docker
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM debian:11-slim

ARG LUFI_VERSION=0.05.21

USER root

RUN apt update \
&& apt install -y \
wget \
unzip \
build-essential \
libssl-dev \
zlib1g-dev \
libio-socket-ssl-perl \
libmojo-pg-perl \
liblwp-protocol-https-perl \
&& apt-get clean -y \
&& rm -rf /var/lib/{apt,dpkg,cache,log,tmp}/*

RUN cpan Carton
WORKDIR /lufi


RUN wget https://framagit.org/fiat-tux/hat-softwares/lufi/-/archive/${LUFI_VERSION}/lufi-${LUFI_VERSION}.zip \
&& unzip lufi-${LUFI_VERSION}.zip -d /tmp \
&& mv /tmp/lufi-${LUFI_VERSION}/* /lufi \
&& rm -rf /tmp/* lufi-${LUFI_VERSION}.zip


COPY lufi.conf /lufi/lufi.conf
COPY docker-entrypoint.sh /lufi/docker-entrypoint.sh
RUN chmod a+x /lufi/docker-entrypoint.sh


RUN carton install --deployment --without=test --without=mysql \
&& rm -rf local/cache/* local/man/*

ENTRYPOINT ["/lufi/docker-entrypoint.sh"]

EXPOSE 8081
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# lufi-docker
Dockerization de Lufi
Dockerization de Lufi, application de transfert de fichier.

Source [ici](https://framagit.org/fiat-tux/hat-softwares/lufi)
7 changes: 7 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Lauch server
carton exec hypnotoad /lufi/script/lufi

# print logs
tail -f /lufi/log/production.log
Loading

0 comments on commit fde0eea

Please sign in to comment.