Skip to content

Commit ba0070c

Browse files
Merge pull request #3 from neshmi/main
Dockerfile improvements
2 parents b211865 + c719d76 commit ba0070c

File tree

2 files changed

+56
-11
lines changed

2 files changed

+56
-11
lines changed

.github/workflows/build-and-push.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Docker container
2+
3+
on:
4+
push:
5+
branches:
6+
- main # or the default branch of your repository
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- name: Check out the repo
17+
uses: actions/checkout@v3
18+
19+
- name: Get short SHA
20+
id: short-sha
21+
run: echo "::set-output name=sha::$(echo $GITHUB_SHA | cut -c1-6)"
22+
23+
- name: Log in to GitHub Container Registry
24+
uses: docker/login-action@v2
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.repository_owner }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Build and push Docker image
31+
uses: docker/build-push-action@v6
32+
with:
33+
context: .
34+
file: ./Dockerfile
35+
push: true
36+
tags: |
37+
ghcr.io/${{ github.repository }}/resourcespace:latest
38+
ghcr.io/${{ github.repository }}/resourcespace:${{ steps.short-sha.outputs.sha }}

Dockerfile

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
FROM ubuntu:latest
2-
MAINTAINER Montala Ltd
1+
FROM ubuntu:24.04
2+
3+
LABEL org.opencontainers.image.authors="Montala Ltd"
4+
35
ENV DEBIAN_FRONTEND="noninteractive"
6+
47
RUN apt-get update && apt-get install -y \
58
nano \
69
imagemagick \
@@ -28,11 +31,13 @@ RUN apt-get update && apt-get install -y \
2831
python3-opencv \
2932
python3 \
3033
python3-pip \
34+
&& apt-get clean \
3135
&& rm -rf /var/lib/apt/lists/*
32-
RUN sed -i -e "s/upload_max_filesize\s*=\s*2M/upload_max_filesize = 100M/g" /etc/php/8.3/apache2/php.ini
33-
RUN sed -i -e "s/post_max_size\s*=\s*8M/post_max_size = 100M/g" /etc/php/8.3/apache2/php.ini
34-
RUN sed -i -e "s/max_execution_time\s*=\s*30/max_execution_time = 300/g" /etc/php/8.3/apache2/php.ini
35-
RUN sed -i -e "s/memory_limit\s*=\s*128M/memory_limit = 1G/g" /etc/php/8.3/apache2/php.ini
36+
37+
RUN sed -i -e "s/upload_max_filesize\s*=\s*2M/upload_max_filesize = 100M/g" /etc/php/8.3/apache2/php.ini \
38+
&& sed -i -e "s/post_max_size\s*=\s*8M/post_max_size = 100M/g" /etc/php/8.3/apache2/php.ini \
39+
&& sed -i -e "s/max_execution_time\s*=\s*30/max_execution_time = 300/g" /etc/php/8.3/apache2/php.ini \
40+
&& sed -i -e "s/memory_limit\s*=\s*128M/memory_limit = 1G/g" /etc/php/8.3/apache2/php.ini
3641

3742
RUN printf '<Directory /var/www/>\n\
3843
\tOptions FollowSymLinks\n\
@@ -42,9 +47,11 @@ RUN printf '<Directory /var/www/>\n\
4247
ADD cronjob /etc/cron.daily/resourcespace
4348

4449
WORKDIR /var/www/html
45-
RUN rm index.html
46-
RUN svn co -q https://svn.resourcespace.com/svn/rs/releases/10.5 .
47-
RUN mkdir filestore
48-
RUN chmod 777 filestore
49-
RUN chmod -R 777 include/
50+
51+
RUN rm -f index.html \
52+
&& svn co -q https://svn.resourcespace.com/svn/rs/releases/10.5 . \
53+
&& mkdir -p filestore \
54+
&& chmod 777 filestore \
55+
&& chmod -R 777 include/
56+
5057
CMD apachectl -D FOREGROUND

0 commit comments

Comments
 (0)