forked from shawon100/Online-Compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (44 loc) · 1.46 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#Use the Ubuntu base image
FROM ubuntu
#Update all packages
RUN apt-get update
#Install tzdata and set timezone.
ENV TZ=America/Chicago
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get -y install tzdata
#Install Software Properties
RUN apt-get update && \
apt-get install -y software-properties-common && \
rm -rf /var/lib/apt/lists/*
#Install C/C++ Compiler
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN apt-get update -y
RUN apt-get install -y gcc-4.8
RUN apt-get install -y g++-4.8
RUN ln -f -s /usr/bin/gcc-4.8 /usr/bin/gcc
RUN ln -f -s /usr/bin/g++-4.8 /usr/bin/g++
#Install Java Compiler
RUN add-apt-repository -y ppa:openjdk-r/ppa
RUN apt-get update -y
RUN apt install -y openjdk-8-jre
RUN apt-get install -y default-jdk
#Install applications
RUN apt-get -y install apache2
RUN apt-get -y install php libapache2-mod-php
#Remove any unnecessary files
RUN apt-get clean
#Setup Apache2 servers
#Debian configuration requires the environment variables APACHE_RUN_USER, APACHE_RUN_GROUP, and APACHE_PID_FILE to be set
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_PID_FILE /var/run/apache2.pid
#Expose ports
EXPOSE 80
#Start services
CMD /usr/sbin/apache2ctl -D FOREGROUND
#Copy files to webserver
COPY Online-Compiler /var/www/html/
#Change Permission
RUN chmod -R 777 /var/www/html/
# Remove Default index.html
RUN rm /var/www/html/index.html