윤준석

ADD: deploymeny configuration

Dockerfile docker-compose.yml, deploy/undeployment shell script
1 +FROM golang:1.17.3-alpine AS builder
2 +
3 +WORKDIR /src
4 +COPY . /src
5 +
6 +RUN go build -o bunjang_api_server
7 +
8 +FROM alpine
9 +
10 +WORKDIR /src
11 +COPY --from=builder /src/bunjang_api_server /src/bunjang_api_server
12 +
13 +EXPOSE 8080
14 +CMD ["./bunjang_api_server"]
1 +#!/usr/bin/env bash
2 +
3 +docker build -t bunjang-api-server .
4 +docker-compose up -d
...\ No newline at end of file ...\ No newline at end of file
1 +version: '3'
2 +
3 +services:
4 + joongna_api:
5 + image: bunjang-api-server
6 + restart: always
7 + container_name: bunjang-api-server-container
8 + ports:
9 + - '18082:8080'
...\ No newline at end of file ...\ No newline at end of file
1 +#!/usr/bin/env bash
2 +
3 +docker-compose down
4 +docker image rm bunjang-api-server
...\ No newline at end of file ...\ No newline at end of file