summaryrefslogtreecommitdiff
path: root/apps/docker/Dockerfile.dev-server
blob: 8924c4688dad550ba7cc9c9e18e2da17b03827f9 (plain)
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
#syntax=docker/dockerfile:1.2

#================================================================
#
# DEV: Stage used for the development environment
#      and the locally built services
#
#=================================================================

FROM ubuntu:22.04 as dev
ARG USER_ID=1000
ARG GROUP_ID=1000
ARG DOCKER_USER=acore
ARG TZ=Etc/UTC

LABEL description="AC base image for dev containers"

# List of timezones: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones

ENV DOCKER=1

# Ensure ac-dev-server can properly pull versions
ENV GIT_DISCOVERY_ACROSS_FILESYSTEM=1

# set timezone environment variable
ENV TZ=$TZ

# set noninteractive mode so tzdata doesn't ask to set timezone on install
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
    && apt-get install -y \
        gdb gdbserver git dos2unix lsb-core sudo curl unzip \
        make cmake clang libmysqlclient-dev libboost-all-dev \
        build-essential libtool cmake-data openssl libgoogle-perftools-dev google-perftools \
        libssl-dev libmysql++-dev libreadline6-dev zlib1g-dev libbz2-dev mysql-client \
        libncurses5-dev ccache tzdata \
  && rm -rf /var/lib/apt/lists/*

# Ensure git will work with the AzerothCore source directory
RUN git config --global --add safe.directory /azerothcore

# change timezone in container
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
    && echo $TZ > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata

# Create a non-root user
RUN addgroup --gid "$GROUP_ID" "$DOCKER_USER" && \
    adduser --disabled-password --gecos '' --uid "$USER_ID" --gid "$GROUP_ID" "$DOCKER_USER" && \
    passwd -d "$DOCKER_USER" && \
    echo "$DOCKER_USER ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers

# must be created to set the correct permissions on them
RUN mkdir -p \
    /azerothcore/env/dist/bin \
    /azerothcore/env/dist/data/Cameras \
    /azerothcore/env/dist/data/dbc \
    /azerothcore/env/dist/data/maps \
    /azerothcore/env/dist/data/mmaps \
    /azerothcore/env/dist/data/vmaps \
    /azerothcore/env/dist/logs \
    /azerothcore/env/dist/temp \
    /azerothcore/env/dist/etc \
    /azerothcore/var/build/obj

# Correct permissions for non-root operations
RUN chown -R $DOCKER_USER:$DOCKER_USER /home/acore /run /opt /azerothcore

USER $DOCKER_USER

# copy only necessary files for the acore dashboard
COPY --chown=$DOCKER_USER:$DOCKER_USER apps /azerothcore/apps
COPY --chown=$DOCKER_USER:$DOCKER_USER bin /azerothcore/bin
COPY --chown=$DOCKER_USER:$DOCKER_USER conf /azerothcore/conf
COPY --chown=$DOCKER_USER:$DOCKER_USER data /azerothcore/data
COPY --chown=$DOCKER_USER:$DOCKER_USER deps /azerothcore/deps
COPY --chown=$DOCKER_USER:$DOCKER_USER acore.json /azerothcore/acore.json
COPY --chown=$DOCKER_USER:$DOCKER_USER acore.sh /azerothcore/acore.sh

# Download deno and make sure the dashboard works
RUN bash /azerothcore/acore.sh quit

WORKDIR /azerothcore