-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 776 Bytes
/
Dockerfile
File metadata and controls
30 lines (21 loc) · 776 Bytes
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
FROM ubuntu:22.04
LABEL author="devhoodit"
RUN apt-get update && \
apt-get -y install sudo && \
sudo apt-get -y install systemctl && \
sudo apt-get -y install wget
# install services
RUN sudo apt-get -y install mysql-server && \
sudo apt-get -y install redis-server && \
wget https://go.dev/dl/go1.21.0.linux-amd64.tar.gz && \
sudo rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz
ENV PATH "/usr/local/go/bin:${PATH}"
ENV DB_PWD=""
RUN mkdir server
# copy files
COPY ./ ./server
# install packages
RUN cd server && go mod download
# CMD
CMD ["/bin/bash", "-c", "sudo systemctl start mysql", "&&", "mysql -u root -e \"alter user 'root'@'localhost' identified with mysql_native_password by '${DB_PWD}';\"" ]
EXPOSE 5500