-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (47 loc) · 2.15 KB
/
Dockerfile
File metadata and controls
56 lines (47 loc) · 2.15 KB
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
# Dockerfile for OGame Open Source
# Some points were borrowed from the deployment by Noli: https://gitlab.com/nolialsea/ogame-opensource-docker
# This deployment only implements a single-domain configuration (the lobby and Universe 1 on the same domain). If you need to separate the universe into a subdomain like uni1.mygame.com, you'll need to come up with your own solution.
FROM php:8.2-apache
# MailHog configuration
# Copy the msmtp configuration file into the container
COPY msmtprc /etc/msmtprc
# Set permissions so it's readable by all users
RUN chmod 644 /etc/msmtprc
# Lobby files (start page)
COPY ./wwwroot /var/www/html
COPY ./download /var/www/html/download
# Universe (game) files
COPY ./game /var/www/html/game
# PHP extensions
COPY php.ini /usr/local/etc/php/conf.d/custom.ini
RUN a2enmod rewrite
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libwebp-dev \
libzip-dev \
zlib1g-dev \
libonig-dev \
msmtp \
&& rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
RUN docker-php-ext-install gd
RUN docker-php-ext-install mbstring mysqli pdo pdo_mysql
# To prevent configuration files from being destroyed after redeployment, you need to make them symbolic links, and drag the configs themselves into the volume
# Create a directory that will be managed by a Docker volume
RUN mkdir -p /var/www/html/persistent_configs
# Change ownership of this directory so the web server can write to it
RUN chown -R www-data:www-data /var/www/html/persistent_configs
# Create two SEPARATE symbolic links for the two config files
RUN ln -s /var/www/html/persistent_configs/root_config.php /var/www/html/config.php
RUN ln -s /var/www/html/persistent_configs/game_config.php /var/www/html/game/config.php
RUN chown -R www-data:www-data /var/www/html
# RUN apt-get update && apt-get install -y cron
# COPY cronfile /etc/cron.d/cronfile
# RUN chmod 0644 /etc/cron.d/cronfile
# RUN crontab /etc/cron.d/cronfile
# CMD ["cron", "-f"]
# C battle engine
RUN g++ /var/www/html/game/battle/*.cpp -lm -o /usr/lib/cgi-bin/battle
RUN chmod 755 /usr/lib/cgi-bin/battle