forked from ppy/osu-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.deployment
75 lines (57 loc) · 1.92 KB
/
Dockerfile.deployment
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
FROM debian:11
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -y apt-transport-https lsb-release ca-certificates curl
RUN curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -y \
build-essential \
git \
jhead \
nginx \
nodejs \
php8.1-common \
php8.1-curl \
php8.1-ds \
php8.1-gd \
php8.1-intl \
php8.1-mbstring \
php8.1-mysql \
php8.1-redis \
php8.1-sqlite3 \
php8.1-swoole \
php8.1-tokenizer \
php8.1-xml \
php8.1-zip \
php8.1 \
zip
RUN npm install -g yarn
WORKDIR /app
RUN curl -L "https://getcomposer.org/download/latest-2.x/composer.phar" > /usr/local/bin/composer && chmod 755 /usr/local/bin/composer
COPY composer.json composer.lock ./
RUN composer install --no-autoloader --no-dev
COPY package.json yarn.lock ./
RUN yarn --prod --ignore-optional --frozen-lockfile
RUN rm -f /var/log/nginx/access.log /var/log/nginx/error.log && \
ln -s /dev/stdout /var/log/nginx/access.log && \
ln -s /dev/stderr /var/log/nginx/error.log
COPY . .
RUN mkdir -p bootstrap/cache storage/logs storage/framework/cache storage/framework/views storage/framework/sessions public/uploads public/uploads-avatar public/uploads-replay
RUN composer dump-autoload
ARG APP_URL
ARG DOCS_URL
RUN yarn production
RUN php artisan ip2asn:update
RUN php artisan scribe:generate
RUN rm -rf node_modules
ARG GIT_SHA
RUN printf "%s" "$GIT_SHA" > version
RUN useradd -m osuweb
RUN chown -R osuweb /var/lib/nginx bootstrap/cache storage
USER osuweb
ENV LOG_CHANNEL stderr
EXPOSE 8000
EXPOSE 8080
ENTRYPOINT ["/app/docker/deployment/entrypoint.sh"]
CMD ["octane"]