-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile
38 lines (26 loc) · 1.01 KB
/
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM php:latest
# Update package lists and install required dependencies
RUN apt-get update && apt-get install -y wget libzip-dev zip
# Install the PHP extension zip
RUN docker-php-ext-install zip
# Install the PHP extension zip
RUN docker-php-ext-install zip
# Install the AWS SDK for PHP using Composer
RUN apt-get install -y git
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer require aws/aws-sdk-php
# Create the output directory
RUN mkdir /output
# Set read and write permissions for the /output directory and its contents
RUN chmod -R 777 /output
COPY inc/ /inc/
# Copy the conversion script
COPY run.php /run.php
# Create a new user named "appuser" with UID/GID 1000
RUN useradd -m -u 1000 -U appuser
# Set the ownership of the /home/appuser directory to "appuser"
RUN chown -R appuser:appuser /home/appuser
# Switch to the non-root user
USER 1000
# Run the conversion script when the container starts
CMD ["/usr/local/bin/php", "/run.php"]