forked from freeciv/freeciv-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
138 lines (124 loc) · 6.33 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Use phusion/baseimage as base image. To make your builds reproducible, make
# sure you lock down to a specific version, not to `latest`!
# See https://github.com/phusion/baseimage-docker/blob/master/Changelog.md for
# a list of version numbers.
FROM phusion/baseimage:latest
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
# Install the base packages and update Ubuntu
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update && apt-get -y upgrade && apt-get install -y sudo lsb-release
# Get the basic dependencies, like Java 8, Python 3, and everything we need to compile freeciv
ADD production/build-apt-get.sh /docker/production/built-apt-get.sh
RUN /docker/production/built-apt-get.sh
# Files for tomcat and other dependencies
# Warning: These values cannot yet be modified
# -- Modifiable environment ends --
ENV TOMCAT_HOME=/var/lib/tomcat8
ENV CATALINA_HOME=${TOMCAT_HOME}
# -- Modifiable environment starts --
ADD production/build-tomcat.sh /docker/production/build-tomcat.sh
RUN /docker/production/build-tomcat.sh
# Base files necessary for freeciv
ADD LICENSE.txt /docker/LICENSE.txt
ADD tests /docker/tests
ADD freeciv /docker/freeciv
# -- Modifiable environment ends --
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
# -- Modifiable environment starts --
ADD production/build-freeciv.sh /docker/production/build-freeciv.sh
RUN /docker/production/build-freeciv.sh
# Clean up APT when done (no other apt-based dependencies from here on out)
RUN sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install freeciv-web, which requires all these environment variables
# Warning: These values cannot yet be modified
# -- Modifiable environment ends --
ENV PUBLITE2_PORT=6000
ENV FREECIV_PROXY_PORT=8002
# TODO: This has to be retrieved in the scorelog_names.patch
ENV FREECIV_WEB_SCORE_LOGS_DIRECTORY=${TOMCAT_HOME}/webapps/data/scorelogs/
ENV FREECIV_WEB_SAVE_GAME_DIRECTORY=${TOMCAT_HOME}/webapps/data/savegames/
ENV FREECIV_WEB_RANK_LOGS_DIRECTORY=${TOMCAT_HOME}/webapps/data/ranklogs/
ENV FREECIV_WEB_DIR=/docker
ENV FREECIV_DATA_PATH=/root/freeciv/share/freeciv/
# -- Modifiable environment starts --
# Build freeciv web
ADD music /docker/music
ADD blender /docker/blender
ADD scripts /docker/scripts
ADD freeciv-web/src/derived /docker/freeciv-web/src/derived
WORKDIR /docker/scripts
ADD production/build-freeciv-web-sync.sh /docker/production/build-freeciv-web-sync.sh
RUN /docker/production/build-freeciv-web-sync.sh
ADD freeciv-web/src/main /docker/freeciv-web/src/main
ADD freeciv-web/build.sh /docker/freeciv-web/build.sh
ADD freeciv-web/pom.xml /docker/freeciv-web/pom.xml
ADD production/build-freeciv-web.sh /docker/production/build-freeciv-web.sh
RUN /docker/production/build-freeciv-web.sh
# Configure nginx
ADD nginx/conf.d/freeciv-web.conf /etc/nginx/conf.d/freeciv-web.conf
ADD nginx/sites-available/freeciv-web /etc/nginx/sites-available/freeciv-web
ADD production/build-nginx.sh /docker/production/build-nginx.sh
RUN /docker/production/build-nginx.sh
# Add the python services
ADD pbem /docker/pbem
ADD freeciv-earth /docker/freeciv-earth
ADD freeciv-proxy /docker/freeciv-proxy
ADD meta-stats /docker/meta-stats
ADD publite2 /docker/publite2
# Add the service runsv scripts for phusion
ADD production/freeciv-earth /etc/service/freeciv-earth
ADD production/meta-stats /etc/service/meta-stats
ADD production/nginx /etc/service/nginx
ADD production/pbem /etc/service/pbem
ADD production/publite2 /etc/service/publite2
ADD production/tomcat8 /etc/service/tomcat8
# Default environment variables (the full scope of the production configuration occurs here)
# The connection URL to the MySQL database.
ENV MYSQL_URL=mysql://localhost:3306/freeciv_web?useSSL=false
# The user with which to connect to MySQL
ENV MYSQL_USER=localuser
# The password with which to connect to MySQL
ENV MYSQL_PASSWORD=localpassword
# The public-facing URL of this Freeciv-Web host. For example, if you plan on accessing Freeciv-Web at
# http://web.freeciv.org/ set this to http://web.freeciv.org/
ENV FREECIV_WEB_ROOT_URL=http://localhost
# A Google reCAPTCHA secret key. Follow the instructions at https://developers.google.com/recaptcha/intro to sign up
# for the appropriate service account and use the secret key you receive here
ENV FREECIV_WEB_CAPTCHA_SECRET=empty
# A Google reCAPTCHA site key. This is the publicly accessible key.
ENV FREECIV_WEB_CAPTCHA_SITE_KEY=empty
# A Mailgun mailing service username. Create a Mailgun account and then create SMTP credentials using the instructions
# from https://help.mailgun.com/hc/en-us/articles/203409084-How-do-I-create-additional-SMTP-credentials-
ENV FREECIV_WEB_MAILGUN_EMAIL_USERNAME=empty
# The Mailgun mailing service password you created following the instructions for the FREECIV_WEB_MAILGUN_EMAIL_USERNAME
ENV FREECIV_WEB_MAILGUN_EMAIL_PASSWORD=empty
# A Google Analytics property ID, typically starting with UA or GA.
ENV FREECIV_WEB_GOOGLE_ANALYTICS_UA_ID=empty
# A Google site verification ID. Follow the instructions on https://www.google.com/webmasters/verification to configure
# this key.
ENV FREECIV_GOOGLE_SITE_VERIFY_KEY=empty
# A Google Sign In client ID. Follow the instructions at https://developers.google.com/identity/sign-in/web/sign-in#specify_your_apps_client_id
# to create a Google platform project and enable Google Sign In. Find the client ID and paste it here.
ENV FREECIV_WEB_GOOGLE_SIGN_IN_CLIENT_KEY=empty
# A token from TrackJS
ENV FREECIV_WEB_TRACK_JS_TOKEN=empty
# Indicates whether this server should start long turn by default
ENV FREECIV_WEB_START_LONGTURN=True
# Space-separated list of ports that will be exposed to host Freeciv long turn games
ENV FREECIV_WEB_LONGTURN_SERVER_PORTS 6003 6004 6005 6006 6007
# The maximum number of single player games this server should keep warm
ENV FREECIV_WEB_SERVER_CAPACITY_SINGLE=2
# The maximum number of multiplayer games this server should keep warm
ENV FREECIV_WEB_SERVER_CAPACITY_MULTI=1
# The maximum number of PBEM games this server should keep warm
ENV FREECIV_WEB_SERVER_CAPACITY_PBEM=1
# The number of seconds to wait until a zero-player-connected game is closed (abandoned due to idling)
ENV FREECIV_WEB_SERVER_IDLE=20
# The maximum number of games to run
ENV FREECIV_WEB_SERVER_LIMIT=999
# Runtime prefix (in case you want to run services locally, this can be changed
ENV FREECIV_RUNTIME_PREFIX=/docker
EXPOSE 80