-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (30 loc) · 879 Bytes
/
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
FROM amazonlinux:2023
RUN yum update -y && \
yum upgrade -y && \
yum install -y \
nginx \
tar \
bzip2 && \
yum clean all
# make directories
RUN mkdir /webapp && \
mkdir /var/www && \
mkdir /var/www/baseball
# copy files
COPY index.html /var/www
COPY dist.tar.bz2 /webapp
COPY baseball.conf /etc/nginx/conf.d
COPY proxy_params /etc/nginx
# setup - extrac tar archive
# in index.html, need to convert absolute (TLD) path '/assets'
# to relative 'assets', otherwise doesn't work through proxy
RUN cd /webapp && \
tar xjvf dist.tar.bz2 && \
rm dist.tar.bz2 && \
cp -r /webapp/dist/* /var/www/baseball && \
rm -rf /webapp/dist && \
cd /var/www/baseball && \
sed -i 's/\/assets/assets/' index.html
# NOTE: this doesn't automatically expose port
# need to be exposed with docker run command
EXPOSE 80